<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('系统管理员操作界面')"/>
    <!--<th:block th:include="include :: bootstrap-select-css"/>-->
    <!--<th:block th:include="include :: jasny-bootstrap-css"/>-->
    <th:block th:include="include :: datetimepicker-css"/>
    <link th:href="@{/ruoyi/css/font-awesome.css}" rel="stylesheet"/>
    <link th:href="@{/ruoyi/css/jquery-confirm.min.css}" rel="stylesheet"/>
    <!--<link th:href="@{/css/zzsc.css}" type="text/css" rel="stylesheet" />-->
</head>
<style type="text/css">
    .table {
        table-layout: fixed;
    }

    #macdz_id {
        width: 200px;
        height: 32px;
        border: none;
        border-bottom: 1px solid #e5e6e7;
    }

    #macdz_id > input {
        height: 21px;
        width: 26.3px;
        border: none;
        text-align: center;
    }

    #macdz_id > input[readonly] {
        background-color: #EEEEEE;
    }

    #macdz_update {
        width: 200px;
        height: 32px;
        border: none;
        border-bottom: 1px solid #e5e6e7;
    }

    #macdz_update > input {
        height: 21px;
        width: 26.3px;
        border: none;
        text-align: center;
    }

    #macdz_update > input[readonly] {
        background-color: #EEEEEE;
    }

    #ipdz_id {
        width: 200px;
        height: 32px;
        border: none;
        border-bottom: 1px solid #e5e6e7;
    }

    #ipdz_id > input {
        height: 21px;
        width: 32.3px;
        border: none;
        text-align: center;
    }

    #ipdz_id > input[readonly] {
        background-color: #EEEEEE;
    }

    #ipdz_update {
        width: 200px;
        height: 32px;
        border: none;
        border-bottom: 1px solid #e5e6e7;
    }

    #ipdz_update > input {
        height: 21px;
        width: 32.3px;
        border: none;
        text-align: center;
    }

    /*.select {*/
        /*border-radius:3px;*/
        /*color:#616263;*/
        /*overflow: hidden;*/
        /*height: 36px;*/
        /*width: 80px;*/
        /*position: relative;*/
        /*display: block;*/
    /*}*/

    /*select{*/
        /*height: 36px;*/
        /*background-color:#f4f4f4;*/
        /*border: 0;*/
        /*outline: none;*/
        /*width: 80px;*/
        /*-webkit-appearance: none;*/
        /*-moz-appearance: none;*/
        /*appearance: none;*/
    /*}*/
    /*.select:after {*/
        /*content:"∧";*/
        /*padding: 12px 8px;*/
        /*position: absolute; right: 10px; top: 0;*/
        /*z-index: 1;*/
        /*text-align: center;*/
        /*width: 10%;*/
        /*height: 100%;*/
        /*pointer-events: none;*/
        /*box-sizing: border-box;*/
    /*}*/

    #ipdz_update > input[readonly] {
        background-color: #EEEEEE;
    }

    @media screen and (max-width: 768px) {
        .labright {
            margin: 10px 0px 10px 0px;
            float: left;
        }

        .xmdiv {
            float: right;
            margin-top: -38px;
            margin-right: 85px;
        }

        .xsqdxa {
            float: right;
            margin-top: -30px;
            margin-left: 100px;
        }

        .gmrqlab {
            margin: 50px 0px 0px -80px;
            float: left;
        }

        .gmrqlab2 {
            margin: 20px 0px 0px 0px;
            float: left;
        }

        .lableft {
            /*font-size: 18px;*/
            margin: 10px 0px 10px 0px;
        }

        #ypdx1lab {
        }

        #ypdx2lab {
        }

        #ypdx3lab {
        }

        .qbdiv {
            margin-top: 500px;
        }

        .qmdiv {
        }

        .ksdiv {
            float: right;
        }

        .wddiv {
            float: right;
            margin-right: 175px;
        }

        .lddiv {
            float: right;
        }

        .sblxdiv {
        }

        #sblxlab {
        }

        .qbinput {
            margin: 0px 10px 0px 0px;
            float: left;
            width: 280px;
            border: none;
            border-bottom: 1px solid #e5e6e7;
            background-color: #ffffff
        }

        .gmrqforinput {
            float: right;
            margin: -30px -10px 0px 50px;
        }

        .txinput {
            margin: 5px -10px 0px 20px;
            float: left;
            width: 30px;
        }

        #sblxdiv2 {
        }

        #scsbbhdiv {
        }

        .gmrqdiv {
            float: left;
            width: 250px;
        }

        .ypdxa {
            margin-top: 10px;
        }

        .fddiv {
            margin: 0px auto;
        }

        body {
            /*text-align:center;*/
            margin: 0px auto;
            font: normal 100% Helvetica, Arial, sans-serif;
        }

        .xsqdiv {
            margin-left: -20px;
            float: right;
            margin-top: 10px;
            padding-right: 3px;
            padding-left: 3px;
            text-align: right;
            background-color: #FFFFFF;
        }

        .xsqinputk {
            float: left;
            margin-right: 100px;
            text-align: right;
            padding-right: 3px;
            padding-left: 3px;
            background-color: #FFFFFF;
            width: 70%;
        }

        .ypinput {
            margin-top: 10px;
            text-align: right;
            padding-right: 3px;
            padding-left: 3px;
            background-color: #FFFFFF;
            width: 70%;
        }

        .ypinput2 {
            margin-top: 10px;
            text-align: right;
            padding-right: 3px;
            padding-left: 3px;
            background-color: #FFFFFF;
            width: 70%;
        }

        .ipdzdiv {
            margin: -40px 0px 0px 110px;
            width: 190px;
        }

        .macdzdiv {
            margin: -35px 0px 0px 110px;
            width: 190px;
            padding-left: 0px;
            padding-right: 0px
        }

        .ypdiv {
            margin-left: 90px;
        }

        .ypmac {
            margin-top: 30px;
        }
    }

    /**电脑屏幕下显示***/
    @media screen and (min-width: 768px) {
        .ypinput {
            text-align: right;
            padding-right: 3px;
            padding-left: 3px;
            background-color: #FFFFFF;
        }

        .ypdxadiv {
            margin-left: -20px
        }

        .ipdzdiv {
            margin-left: -5px;
            width: 190px;
        }

        .macdzdiv {
            margin-left: -5px;
            width: 190px;
            padding-left: 0px;
            padding-right: 0px
        }

        .ypdiv {
            margin-left: -20px;
            width: 150px;
        }

        .labright {
            margin-left: -80px
        }

        .gmrqlab {
            margin-left: -80px;
        }

        .gmrqlab2 {
            margin-left: -80px;
        }

        .lableft {
            margin-left: -10px
        }

        .txinput {
            border: none;
            border-bottom: 1px solid #e5e6e7;
            background-color: #ffffff
        }

        #ypdx1lab {
            margin-left: -80px
        }

        #ypdx3lab {
            margin-left: -80px
        }

        .qbdiv {
            margin-top: -10px;
            margin-left: -65px
        }

        .qmdiv {
            margin-left: -65px;
            margin-top: -10px
        }

        .ksdiv {
            margin-left: -20px;
            width: 220px
        }

        .qbinput {
            border: none;
            border-bottom: 1px solid #e5e6e7;
            background-color: #ffffff
        }

        .gmrqforinput {
            border: none;
            border-bottom: 1px solid #e5e6e7;
            background-color: #ffffff
        }

        .wddiv {
            margin-left: -20px;
            width: 145px
        }

        .lddiv {
            margin-left: -35px;
            width: 80px
        }

        .sblxdiv {
            margin-left: -20px;
            width: 160px
        }

        #sblxlab {
            margin-left: -30px
        }

        #sblxdiv2 {
            margin-left: -20px;
            width: 190px
        }

        #scsbbhdiv {
            margin-left: 120px;
            margin-top: -30px;
            width: 190px;
        }

        .gmrqdiv {
            margin-left: -20px;
            width: 183px
        }

        .ypdxa {
            width: 60px;
            color: #ffffff;
            text-align: center;
            padding-left: 8px;
            display: inline-block
        }

        .xsqdiv {
            margin-left: -10px;
            width: 130px;
            padding-right: 3px;
            padding-left: 3px;
            text-align: right;
            background-color: #FFFFFF;
        }

        .ypmac {
            margin-left: -65px
        }

        #xsqcc_btn {
            width: 60px;
            margin-left: -10px;
            color: #ffffff;
            text-align: center;
            padding-left: 8px;
            display: inline-block;
        }

        body {
            /*text-align:center;*/
            margin: 0px auto;
        }
    }

    .header {
        width: 98%;
        height: 60px;
        position: fixed;
        left: 0;
        top: 0;
        z-index: 100;
        background-color: #fff;
        border-bottom: 1px solid #0052a4;
        align-content: center;
    }

</style>
<body class="gray-bg">

    <!--<ul class="w">-->
        <!--<li><a onclick="resetPwd()">修改密码</a></li>-->
        <!--<li><a onclick="zx()"><i class="fa fa-sign-out text-danger"></i>&nbsp;|&nbsp;注销用户</a></li>-->
    <!--</ul>-->

<!--<div class="w">-->
    <!--<div class="winBody">-->
        <!--我爱中国！！//你的悬浮框想要展示的内容-->
    <!--</div>-->
<!--</div>-->
<!--生成二维码开始-->
<div class="modal fade" id="empAddModal" tabindex="-1" role="dialog" aria-hidden="true"
     data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">生成设备二维码</h4>
            </div>
            <div class="modal-body">
                <form id="form-user-add" class="form-horizontal">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <input name="went" disabled id="text" class="form-control" type="text">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <div class="ibox-content no-padding">
                                    <div class="edittosummernote" id="qrcode"
                                         style="width:100px; height:100px; margin-top:15px;">
                                    </div>
                                    <input name="qrcode" id="qrcode_update_input_15" class="form-control" type="hidden">
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer" style="margin-top: -30px">
                <button type="button" class="btn btn-white" data-dismiss="modal" style="margin-top: -5px">关闭</button>
                <button type="button" class="btn btn-white" id="emp_save_btn" onclick="updatespkfk(this)"
                        style="margin-top: -5px">保存
                </button>
            </div>
        </div>
    </div>
</div>
<!--生成二维码结束-->

<!--修改的模态框开始-->
<div class="modal fade" id="sbupdateModal" tabindex="-1" role="dialog" aria-hidden="true"
     data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h1 class="modal-title"><strong>修改设备</strong></h1>
                <small style="color: red">请按照原设备信息格式进行更正</small>
            </div>
            <div class="modal-body">
                <form id="form-sb-update" class="formsbxg form-horizontal">
                    <div class="row qbdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">公司名称</label>
                            <div class="col-sm-2 ksdiv">
                                <input type="text" readonly="readonly" class="form-control qbinput" id="gsid_update"
                                       name="gsid" style="background-color: #ffffff">
                            </div>
                            <label class="col-sm-2 control-label labright">设备名称</label>
                            <div class="col-sm-2 ksdiv">
                                <input name="sbmc" id="sbmc_update" class="form-control qbinput" type="text"
                                       readonly="readonly" style="background-color: #ffffff">
                            </div>
                            <label class="col-sm-2 control-label labright">设备编号</label>
                            <div class="col-sm-2 ksdiv">
                                <input name="sbbh" id="sbbh_update" class="form-control qbinput" type="text"
                                       readonly="readonly" style="background-color: #ffffff">
                            </div>
                            <!--<div class="col-sm-1"><img src="/img/700.gif" style="margin-left: -25px;width: 200%"></div>-->

                        </div>
                    </div>
                    <div class="row qmdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">品牌型号</label>
                            <div class="col-sm-2 ksdiv">
                                <input name="guige" id="guige_update" class="form-control qbinput" type="text">
                            </div>
                            <label class="col-sm-2 control-label labright">生产厂家</label>
                            <div class="col-sm-2 ksdiv">
                                <input name="shccj" id="shccj_update" class="form-control qbinput" type="text">
                            </div>
                            <label class="col-sm-2 control-label labright">购买日期</label>
                            <div class="col-sm-2 input-group date gmrqdiv">
                                <span class="input-group-addon qbinput"><i class="fa fa-calendar"></i></span>
                                <input name="gmrq" id="gmrq_update" class="form-control qbinput" type="text"
                                       readonly="readonly" style="background-color: #FFFFFF;">
                            </div>
                        </div>
                    </div>
                    <div class="row qmdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">主板型号</label>
                            <div class="col-sm-1 ksdiv">
                                <input name="zbxh" id="zbxh_update" class="form-control qbinput" type="text">
                            </div>
                            <label class="col-sm-2 control-label labright">CPU型号</label>
                            <div class="col-sm-1 ksdiv">
                                <input name="cpuxh" id="cpuxh_update" class="form-control qbinput" type="text">
                            </div>
                            <label class="col-sm-2 control-label labright">显&nbsp;&nbsp;示&nbsp;&nbsp;器</label>
                            <!--<div class="col-sm-1" style="margin-left:-20px;width: 220px">-->
                            <!--<input name="xsqppcc" id="xsqppcc_id" class="form-control" type="text"-->
                            <!--placeholder="请输入显示器品牌与尺寸" style="border: none;border-bottom: 1px solid #e5e6e7;">-->
                            <!--</div>-->

                            <div class="col-sm-1 ksdiv">
                                <div class="input-group">
                                    <!--下拉框输入选择-->
                                    <!--<input name="xsqppcc" id="xsqpp_id" class="form-control" list="browsersforxsq"-->
                                    <!--placeholder="品牌助记码"-->
                                    <!--style="border: none;border-bottom: 1px solid #e5e6e7;margin-left:-35px;width: 112px">-->
                                    <!--<datalist id="browsersforxsq"></datalist>-->
                                    <input name="xsqppcc" id="xsqppcc_update" class="form-control qbinput"
                                           style="width: 190px;">
                                    <span class="help-block"></span>

                                </div>
                            </div>
                            <!--<div class="col-sm-1">-->
                            <!--<div class="input-group">-->
                            <!--&lt;!&ndash;<input name="xsqppcc" id="xsqcc_id" class="form-control" placeholder="尺寸"&ndash;&gt;-->
                            <!--&lt;!&ndash;style="border: none;border-bottom: 1px solid #e5e6e7;padding-right: 3px;padding-left: 3px;">&ndash;&gt;-->
                            <!--<a class="btn btn-rounded btn-primary btn-sm" id="xsqcc_update_btn"-->
                            <!--style="width: 60px; margin-left: -20px; color: #ffffff; text-align: center;padding-left: 8px; display:inline-block;">显示器</a>-->
                            <!--<span class="help-block"></span>-->
                            <!--</div>-->
                            <!--</div>-->
                        </div>
                    </div>
                    <div class="row qmdiv">
                        <div class="form-group">


                            <label class="col-sm-2 control-label lableft">显卡型号</label>
                            <div class="col-sm-1 ksdiv">
                                <input name="xkxh" id="xkxh_update" class="form-control qbinput" type="text">
                            </div>

                            <label class="col-sm-2 control-label labright">内存大小</label>
                            <div class="col-sm-1 ksdiv">
                                <input name="ncggdx" id="ncggdx_update" class="form-control qbinput" type="text"
                                       onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"
                                       onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}">
                            </div>
                            <label class="col-sm-2 control-label ypmac" id="ypdx1lab">硬盘信息</label>
                            <div class="col-sm-1 ksdiv">
                                <input name="ypdx" id="ypdx_update_1" class="form-control qbinput" type="text">
                            </div>
                            <!--<div class="col-sm-1" style="margin-left:-20px">-->
                            <!--<a class="btn btn-primary btn-rounded btn-sm" id="ypdx_update_btn_1"-->
                            <!--style="width: 60px; color: #ffffff; text-align: center;padding-left: 8px; display:inline-block">硬盘一</a>-->
                            <!--</div>-->

                        </div>
                    </div>
                    <div class="row qmdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">IP&nbsp;&nbsp;地&nbsp;&nbsp;址</label>
                            <!--<div class="col-sm-1 ksdiv">-->
                            <!--<input name="ipdz" id="ipdz_update" class="form-control qbinput" type="text"-->
                            <!--style="width: 190px">-->
                            <!--</div>-->


                            <div class="col-sm-1" id="ipdz_update" style="margin-left:-5px;width: 190px">
                                <input type="text" value="" id="ipdz1_update" class="ip1" maxlength="3">.<input
                                    type="text" value="" id="ipdz2_update" class="ip2" maxlength="3">.<input
                                    type="text" value="" id="ipdz3_update" class="ip3" maxlength="3">.<input
                                    type="text" value="" id="ipdz4_update" class="ip4" maxlength="3">
                            </div>
                            <input type="hidden" name="ipdz" id="ipupdate">
                            <label class="col-sm-2 control-label ypmac">MAC地址</label>
                            <div class="col-sm-1" id="macdz_update"
                                 style="margin-left:-5px;width: 190px;padding-left: 0px;padding-right: 0px">
                                <input type="text" value="" class="mac1update" maxlength="2" style="width: 25px">-
                                <input type="text" value="" class="mac2update" maxlength="2" style="width: 25px">-
                                <input type="text" value="" class="mac3update" maxlength="2" style="width: 25px">-
                                <input type="text" value="" class="mac4update" maxlength="2" style="width: 25px">-
                                <input type="text" value="" class="mac5update" maxlength="2" style="width: 25px">-
                                <input type="text" value="" class="mac6update" maxlength="2" style="width: 25px">
                            </div>
                            <input type="hidden" name="macdz" id="macupdate">
                            <label class="col-sm-2 control-label ypmac" id="ypdx2lab">硬盘信息</label>
                            <div class="col-sm-1 ksdiv">
                                <input name="ypdx" id="ypdx_update_2" class="form-control qbinput" type="text">
                            </div>
                        </div>
                    </div>
                    <div class="row qmdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">使用部门</label>
                            <div class="col-sm-1 wddiv">
                                <div class="input-group">
                                    <select name="bm" class="form-control m-b qbinput" id="bmid_update"></select>
                                    <!--<select name="bm" class="form-control" id="selectbm">-->
                                </div>
                            </div>
                            <div class="col-sm-1">
                                <div class="input-group">
                                    <input name="shiyr" id="shiyr_update" class="form-control lddiv qbinput"
                                           style="width: 80px"
                                           list="browsers_update">
                                    <datalist id="browsers_update"></datalist>
                                    <span class="help-block"></span>
                                </div>
                            </div>

                            <label class="col-sm-2 control-label labright">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
                            <div class="col-sm-10 ksdiv">
                                <input name="beiz" id="beiz_update" class="form-control qbinput" type="text">
                            </div>
                            <label class="col-sm-2 control-label" id="ypdx3lab">硬盘信息</label>
                            <div class="col-sm-1 ksdiv">
                                <input name="ypdx" id="ypdx_update_3" class="form-control qbinput" type="text">
                            </div>
                            <!--<div class="col-sm-1" style="margin-left:-20px">-->
                            <!--<a class="btn btn-rounded btn-primary btn-sm" id="ypdx_update_btn_3"-->
                            <!--style="width: 60px; color: #ffffff; text-align: center;padding-left: 8px; display:inline-block">硬盘三</a>-->
                            <!--</div>-->
                        </div>
                    </div>
                    <div class="row qmdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">升级备注</label>
                            <div class="col-sm-2 ksdiv">
                                <input name="sjbeiz" id="sjbeiz_update" class="form-control qbinput" type="text">
                            </div>
                            <label class="col-sm-2 control-label labright">报废备注</label>
                            <div class="col-sm-2 ksdiv">
                                <input name="bfbeiz" id="bfbeiz_update" class="form-control qbinput" type="text">
                            </div>
                            <label class="col-sm-2 control-label labright">显示器日期</label>
                            <div class="col-sm-2 input-group date gmrqdiv">
                                <span class="input-group-addon qbinput"><i class="fa fa-calendar"></i></span>
                                <input name="xsqgmrq" id="xsqgmrq_update" class="form-control qbinput" type="text"
                                       readonly="readonly" style="background-color: #FFFFFF;">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <div class="modal-footer" style="height:0px">
                                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                <button type="button" class="btn btn-white" id="sb_update_btn" onclick="updatesb()">保存
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!--修改模态框结束-->

<!--添加模态框开始-->
<div class="modal fade" id="sbAddModal" tabindex="-1" role="dialog" aria-hidden="true"
     data-keyboard="false" onkeydown="savesbenter()">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h1 class="modal-title"><strong>添加设备</strong></h1>
                <small style="color: blue">选择设备类型后，请务必点击生成设备编码</small>
            </div>
            <div class="modal-body">
                <form id="form-sb-add" class="form-horizontal">
                    <div class="row qbdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">设备类型</label>
                            <div class="col-sm-2 sblxdiv">
                                <select name="sbbh_sel" id="sbbh_sel" class="form-control qbinput">
                                    <option value="">请选择设备类型</option>
                                </select>
                                <input type="hidden" id="maxbh" name="maxbh">
                            </div>
                            <label class="col-sm-2 control-label" id="sblxlab">设备名称</label>
                            <div class="col-sm-2" id="sblxdiv2">
                                <input name="sbmc" id="sbmc_id" class="form-control qbinput" type="text"
                                       placeholder="请输入设备名称"
                                       readonly="readonly" style="background-color: #ffffff">
                                <input type="hidden" id="sbmc_option">
                                <input type="hidden" id="sbmc_index">
                                <input type="hidden" id="gsidfrotj" name="gsid">
                            </div>
                            <div class="col-sm-1">
                                <a class="btn btn-primary btn-rounded btn-sm" id="creat_sbbh_btn">
                                    <i class="fa fa-search"></i>生成设备编号</a>
                            </div>
                            <div class="col-sm-2" id="scsbbhdiv">
                                <input name="sbbh" placeholder="请点击生成设备编号" id="sbbh_id" class="form-control qbinput"
                                       type="text"
                                       readonly="readonly"
                                       style="background-color: #FFFFFF"
                                       required="required"></div>
                            <!--<div class="col-sm-1"><img src="/img/700.gif" style="margin-left: -25px;width: 200%"></div>-->

                        </div>
                    </div>
                    <div class="row qmdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">品牌型号</label>
                            <div class="col-sm-2 ksdiv">
                                <input name="guige" id="guige_id" class="form-control qbinput" type="text"
                                       placeholder="请输入品牌型号" required="required">
                            </div>
                            <label class="col-sm-2 control-label labright">生产厂家</label>
                            <div class="col-sm-2 ksdiv">
                                <input name="shccj" id="shccj_id" class="form-control qbinput" type="text"
                                       placeholder="请输入生产厂家">
                            </div>
                            <label class="col-sm-2 control-label gmrqlab">购买日期</label>
                            <div class="col-sm-2 input-group date gmrqdiv">
                                <span class="input-group-addon txinput"><i class="fa fa-calendar"></i></span>
                                <input name="gmrq" id="gmrq_id" class="form-control gmrqforinput" type="text"
                                       readonly="readonly" placeholder="yyyy-MM-dd"
                                       style="background-color: #FFFFFF;">
                                <input name="xsqgmrq" id="xsqgmrq_id" type="hidden">
                            </div>
                        </div>
                    </div>
                    <div class="row qmdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">主板型号</label>
                            <div class="col-sm-1 ksdiv">
                                <input name="zbxh" id="zbxh_id" class="form-control qbinput" type="text"
                                       placeholder="请输入主板型号">
                            </div>
                            <label class="col-sm-2 control-label labright">CPU型号</label>
                            <div class="col-sm-1 ksdiv">
                                <input name="cpuxh" id="cpuxh_id" class="form-control qbinput" type="text"
                                       placeholder="请输入CPU型号">
                            </div>
                            <label class="col-sm-2 control-label gmrqlab">显&nbsp;&nbsp;示&nbsp;&nbsp;器</label>
                            <!--<div class="col-sm-1" style="margin-left:-20px;width: 220px">-->
                            <!--<input name="xsqppcc" id="xsqppcc_id" class="form-control" type="text"-->
                            <!--placeholder="请输入显示器品牌与尺寸" style="border: none;border-bottom: 1px solid #e5e6e7;">-->
                            <!--</div>-->

                            <div class="col-sm-1 xsqdiv">
                                <!--下拉框输入选择-->
                                <!--<input name="xsqppcc" id="xsqpp_id" class="form-control" list="browsersforxsq"-->
                                <!--placeholder="品牌助记码"-->
                                <!--style="border: none;border-bottom: 1px solid #e5e6e7;margin-left:-35px;width: 112px">-->
                                <!--<datalist id="browsersforxsq"></datalist>-->
                                <input name="xsqppcc" id="xsqppcc_id" class="form-control qbinput xsqinputk"
                                       placeholder="显示器品牌尺寸信息"
                                       readonly="readonly">
                                <span class="help-block"></span>
                            </div>
                            <div class="col-sm-1 fddiv">
                                <!--<input name="xsqppcc" id="xsqcc_id" class="form-control" placeholder="尺寸"-->
                                <!--style="border: none;border-bottom: 1px solid #e5e6e7;padding-right: 3px;padding-left: 3px;">-->
                                <a class="btn btn-rounded btn-primary btn-sm xsqdxa" id="xsqcc_btn">显示器</a>
                                <span class="help-block"></span>
                            </div>
                        </div>
                    </div>
                    <div class="row qmdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">显卡型号</label>
                            <div class="col-sm-1 ksdiv">
                                <input name="xkxh" id="xkxh_id" class="form-control qbinput" type="text"
                                       placeholder="请输入显卡型号">
                            </div>
                            <label class="col-sm-2 control-label labright">内存大小</label>
                            <div class="col-sm-1 ksdiv">
                                <input name="ncggdx" id="ncggdx_id" class="form-control qbinput" type="text"
                                       onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"
                                       onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"
                                       placeholder="请输入内存大小只能输入数字">
                            </div>
                            <label class="col-sm-2 control-label gmrqlab">硬盘信息</label>
                            <div class="col-sm-1 ypdiv">
                                <input name="ypdx" id="ypdx_id_1" class="form-control qbinput ypinput" type="text"
                                       readonly="readonly"
                                       placeholder="请点击硬盘一按钮     ">
                            </div>
                            <div class="col-sm-1 ypdxadiv">
                                <a class="btn btn-primary btn-rounded btn-sm ypdxa" id="ypdx_btn_1">硬盘一</a>
                            </div>

                        </div>
                    </div>
                    <div class="row qmdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">IP&nbsp;&nbsp;地&nbsp;&nbsp;址</label>
                            <div class="col-sm-1 ipdzdiv" id="ipdz_id">
                                <input type="text" value="" id="ipdz1" class="ip1" maxlength="3">.<input
                                    type="text" value="" id="ipdz2" class="ip2" maxlength="3">.<input
                                    type="text" value="" id="ipdz3" class="ip3" maxlength="3">.<input
                                    type="text" value="" id="ipdz4" class="ip4" maxlength="3">
                            </div>
                            <input type="hidden" name="ipdz" id="ip">
                            <label class="col-sm-2 control-label ypmac">MAC地址</label>
                            <div class="col-sm-1 macdzdiv" id="macdz_id">
                                <input type="text" value="" class="mac1" maxlength="2" style="width: 25px">-
                                <input type="text" value="" class="mac2" maxlength="2" style="width: 25px">-
                                <input type="text" value="" class="mac3" maxlength="2" style="width: 25px">-
                                <input type="text" value="" class="mac4" maxlength="2" style="width: 25px">-
                                <input type="text" value="" class="mac5" maxlength="2" style="width: 25px">-
                                <input type="text" value="" class="mac6" maxlength="2" style="width: 25px">
                            </div>
                            <input type="hidden" name="macdz" id="mac">
                            <label class="col-sm-2 control-label gmrqlab2">硬盘信息</label>
                            <div class="col-sm-1 ypdiv">
                                <input name="ypdx" id="ypdx_id_2" class="form-control qbinput ypinput2" type="text"
                                       readonly="readonly"
                                       placeholder="请点击硬盘二按钮     "
                                       style="text-align:right;padding-right: 3px;padding-left: 3px;background-color: #FFFFFF">
                            </div>
                            <div class="col-sm-1 ypdxadiv">
                                <a class="btn btn-rounded btn-primary btn-sm ypdxa" id="ypdx_btn_2">硬盘二</a>
                            </div>
                        </div>
                    </div>
                    <div class="row qmdiv">
                        <div class="form-group">
                            <label class="col-sm-2 control-label lableft">使用部门</label>
                            <div class="col-sm-1 wddiv">
                                <div class="input-group">
                                    <select name="bm" class="form-control m-b qbinput" id="bmid_id">
                                    </select>
                                </div>
                            </div>
                            <div class="col-sm-1">
                                <div class="input-group xmdiv">
                                    <input name="shiyr" id="shiyr_id" class="form-control qbinput lddiv"
                                           style="width: 80px" list="browsers" placeholder="姓名拼音">
                                    <datalist id="browsers"></datalist>
                                    <span class="help-block"></span>
                                </div>
                            </div>

                            <label class="col-sm-2 control-label labright">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
                            <div class="col-sm-10 ksdiv">
                                <input name="beiz" id="beiz_id" class="form-control qbinput" type="text"
                                       placeholder="请输入备注">
                                <input name="sjbeiz" id="sjbeiz_id" type="hidden">
                                <input name="bfbeiz" id="bfbeiz_id" type="hidden">
                            </div>
                            <label class="col-sm-2 control-label gmrqlab">硬盘信息</label>
                            <div class="col-sm-1 ypdiv">
                                <input name="ypdx" id="ypdx_id_3" class="form-control qbinput ypinput" type="text"
                                       readonly="readonly"
                                       placeholder="请点击硬盘三按钮     "
                                       style="text-align:right;padding-right: 3px;padding-left: 3px;background-color: #FFFFFF">
                            </div>
                            <div class="col-sm-1 ypdxadiv">
                                <a class="btn btn-rounded btn-primary btn-sm ypdxa" id="ypdx_btn_3">硬盘三</a>
                            </div>
                        </div>
                    </div>
                    <div class="row" style="display: none">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <input name="went" disabled id="tj_text" class="form-control" type="text">
                            </div>
                        </div>
                    </div>
                    <div class="row" style="display: none">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <div id="tj_qrcode" style="width:100px; height:100px; margin-top:15px;"></div>
                                <input name="qrcode" id="tj_qrcode_update_input_15" class="form-control" type="hidden">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <div class="modal-footer" style="height:0px">
                                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                <button type="button" class="btn btn-white" id="sb_save_btn" onclick="savesb()">保存
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!--添加模态框结束-->
<div class="container-div">
    <div class="row" style="height: 5%">
        <div class="col-sm-12 search-collapse" >
            <div class="select-list">
                <!--<ul>-->
                    <!--<li>-->
                        <!--<a href="/sbgl/sbxxb/sbxxb">-->
                            <!--<img src="/img/logo.png" style="width: 80%;height: 80%">-->
                        <!--</a>-->
                    <!--</li>-->
                    <!--<li>-->
                        <!--<p style="width: 100%;text-align: center;margin: 0px auto"><strong style="text-align: center; font-size: 28px;font-family: 微软雅黑">计算机设备管理模块</strong></p>-->
                    <!--</li>-->
                <!--</ul>-->
                <p style="text-align: center;margin-bottom: -5px;">
                    <a href="/sbgl/sbxxb/sbxxb"><img style="float: left;margin-top: 5px" src="/img/logo.png"></a><strong style="font-size: 40px;font-family: 微软雅黑;">计算机设备管理模块</strong>
                </p>
            </div>
        </div>
    </div>
    <!--<div style="height: 6%"></div>-->
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="operlog-form">
                <div class="select-list" style="float: right">
                    <ul>
                        <!--<li><p style="width: 100%">安徽海王国安</p></li>-->
                        <li>
                            <label>检索：</label><input type="text" name="sbbh" id="sbbh" placeholder="请输入设备编码进行查询"
                                                     onkeydown="if(event.keyCode==13){event.keyCode=0;event.returnValue=false;$.alert('请点击后面的搜索框','温馨提示');}"/>
                        </li>
                        <li>
                            是否显示报废：<select name="bfbs" style="width: 50px" id="is_bf">
                            <option value="0">否</option>
                            <option value="1">是</option>
                            <option value="">所有</option>
                        </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" id="search_btn"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="tjsb()" id="tjsb">
                <i class="fa fa-pencil"></i> 添加设备
            </a>
            <a class="btn btn-danger" onclick="Mysbtz()" id="remove">
                <i class="fa fa-remove"></i> 设备台账打印
            </a>
            <a class="btn btn-info" onclick="MyPreview()" id="print">
                <i class="fa fa-remove"></i> 二维码打印
            </a>
            <a class="btn btn-info" onclick="dywhjl()" id="whjldx">
                <i class="fa fa-remove"></i> 打印维护记录
            </a>
            <a th:href="@{/sbgl/sbxxb/exportExcel}" class="btn btn-danger" id="exportExcel">导出</a>
            <div class="col-sm-4" style="margin-left:-20px;width: 250px">
                <select name="sbmc_sel" id="sbmc_sel" class="form-control">
                    <option value="GASB-">请选择打印设备名称</option>
                </select>
            </div>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
        <!--&lt;!&ndash;&lt;!&ndash;显示的页脚&ndash;&gt;&ndash;&gt;-->
        <!--<div class="col-sm-12 search-collapse">-->
            <!--<form id="footform" class="form-horizontal">-->
                <!--<label class="control-label" style="margin-left: 100px">登录人：</label>-->
                <!--<div class="">-->
                    <!--<input name="shiyr" id="dengmz" class="form-control" type="text"-->
                           <!--placeholder="请输入登录人"-->
                           <!--style="border: none;text-align:right;padding-right: 3px;padding-left: 3px">-->
                    <!--<input name="shiyr" id="gsids" class="form-control" type="text"-->
                           <!--placeholder="请输入登录人"-->
                           <!--style="border: none;text-align:right;padding-right: 3px;padding-left: 3px">-->
                <!--</div>-->
            <!--</form>-->
        <!--</div>-->

        <!--4.设置底部div固定不动，是通过CSS设置的-->
        <!--<div id="yjm" class="col-sm-12 search-collapse">-->
            <!--<label class="col-lg-6 control-label" style="text-align: center">已扫描药监码数量：</strong></label>-->
            <!--<div class="col-lg-6">-->
                <!--<p type="text" id="scan"></p>-->
            <!--</div>-->
        <!--</div>-->

        <!--<div id="rightMenu">-->
            <!--<ul>-->
                <!--<li id="xg" onclick="xg()"><strong>修改密码</strong></li>-->
                <!--<li id="zx" onclick="zx()"><strong>注销用户</strong></li>-->
            <!--</ul>-->
        <!--</div>-->

        <div class="row" th:replace="zdyyj :: myfooter"></div>
        <!--<iframe name="content_iframe" width=100% height=100% th:src="@{/zdyyj}" frameborder=0></iframe>-->
        <!--<div id="task-bar">-->
            <!--<ul class="task-panel">-->
                <!--<li class="sys" title="系统设定"><b class="">系统设定</b></li>-->
            <!--</ul>-->
        <!--</div>-->

        <!--隐藏的打印设备标签二维码表格开始-->
        <div class="col-sm-12 select-table table-striped" id="divid" style="display: none">
        </div>
        <!--隐藏的打印设备标签二维码表格结束-->
        <!--隐藏的打印设备台账表格开始-->
        <div class="col-sm-12 select-table table-striped" id="divid_sbtz" style="display: none">
            <table class='table table-hover table-bordered' cellpadding='0' border='1' cellspacing='0'
                   id="tableid_sbtz">
                <thead>
                <div><p>计算机设施设备管理台帐</p></div>
                <tr style="font-size: 9pt;font-family: 微软雅黑;">
                    <td align="center" id="yc_xh" style="background-color: #99CCFF">序号</td>
                    <td align="center" id="yc_sbbh" style="background-color: #99CCFF">设备编号</td>
                    <td align="center" id="yc_sbmc" style="background-color: #99CCFF">设备名称</td>
                    <!--<td align="center" id="yc_ggxh" style="background-color: #99CCFF">规格型号</td>-->
                    <td align="center" id="yc_zbxh" style="background-color: #99CCFF">主板</td>
                    <td align="center" id="yc_cpuxh" style="background-color: #99CCFF">CPU</td>
                    <td align="center" id="yc_ncdx" style="background-color: #99CCFF">内存</td>
                    <td align="center" id="yc_ypdx" style="background-color: #99CCFF">硬盘</td>
                    <td align="center" id="yc_xsqdx" style="background-color: #99CCFF">显示器</td>
                    <td align="center" id="yc_dw" style="background-color: #99CCFF">单位</td>
                    <td align="center" id="yc_shul" style="background-color: #99CCFF">数量</td>
                    <td align="center" id="yc_shchd" style="background-color: #99CCFF">生产厂商</td>
                    <td align="center" id="yc_gmrq" style="background-color: #99CCFF">购置日期</td>
                    <td align="center" id="yc_ipdz" style="background-color: #99CCFF">IP</td>
                    <td align="center" id="yc_maxdz" style="background-color: #99CCFF">MAC</td>
                    <td align="center" id="yc_bm" style="background-color: #99CCFF">部门</td>
                    <td align="center" id="yc_shiyr" style="background-color: #99CCFF">签字</td>
                    <td align="center" id="yc_beiz" style="background-color: #99CCFF">备注</td>
                </tr>
                </thead>
                <tbody id="tbody_id">
                </tbody>
            </table>
        </div>
        <!--隐藏的打印设备台账表格结束-->
        <!--隐藏的打印设备登记表开始-->
        <div class="col-sm-12 select-table table-striped" id="divid_sbxq" style="display: none">
            <table class='table table-hover table-bordered' cellpadding='0' border='1' cellspacing='0'
                   style="width: 700px">
                <thead style='height: 30pt;'>
                <tr style="font-size: 16pt;font-family: 微软雅黑;">
                    <th colspan="8" style="background-color: #99CCFF"><h3 class="font-bold text-center">设备详情</h3></th>
                </tr>
                </thead>
                <tbody id="tbody_djb" style='height: 22pt;'>
                </tbody>
            </table>
        </div>
        <div class="col-sm-12 select-table table-striped" id="divid_sbpzcs" style="display: none">
            <table class='table table-hover table-bordered' cellpadding='0' border='1' cellspacing='0'
                   style="width: 700px">
                <thead style='height: 30pt;'>
                <tr style="font-size: 16pt;font-family: 微软雅黑;">
                    <th colspan="8" style="background-color: #99CCFF"><h3 class="font-bold text-center">配置参数</h3></th>
                </tr>
                </thead>
                <tbody id="tbody_pzcs" style='height: 22pt'>
                </tbody>
            </table>
        </div>
        <div class="col-sm-12 select-table table-striped" id="divid_sbmqzt" style="display: none">
            <table class='table table-hover table-bordered' cellpadding='0' border='1' cellspacing='0'
                   style="width: 700px">
                <thead style='height: 30pt;'>
                <tr style="font-size: 16pt;font-family: 微软雅黑;">
                    <th colspan="8" style="background-color: #99CCFF"><h3 class="font-bold text-center">目前状态</h3></th>
                </tr>
                </thead>
                <tbody id="tbody_mqzt" style='height: 22pt'>
                </tbody>
            </table>
        </div>
        <!--隐藏的打印设备登记表结束-->
        <!--隐藏的维护记录表开始-->
        <div id="divid_sbwh" class="col-sm-12 select-table table-striped" style="display: none">
            <table class="table table-hover table-bordered" cellpadding='0' border='1' cellspacing='0'
                   style="width: 700px">
                <thead style="background-color: #99CCFF;height: 22pt">
                <tr style="font-family: 微软雅黑;">
                    <td align="center" id="wh_xh" style="background-color: #99CCFF;width: 80px">序号</td>
                    <td align="center" id="wh_whrq" style="background-color: #99CCFF;width: 91px">维护日期</td>
                    <td align="center" id="wh_gzms" style="background-color: #99CCFF;width: 172px">故障描述</td>
                    <td align="center" id="wh_whjg" style="background-color: #99CCFF;width: 173px">维护结果</td>
                    <td align="center" id="wh_qz" style="background-color: #99CCFF;width: 80px">签字</td>
                    <td align="center" id="wh_bz" style="background-color: #99CCFF;">备注</td>
                </tr>
                </thead>
                <tbody style="height: 22pt">
                <tr align="center">
                    <td style="background-color: #99CCFF;">1</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr align="center">
                    <td style="background-color: #99CCFF;">2</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr align="center">
                    <td style="background-color: #99CCFF;">3</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr align="center">
                    <td style="background-color: #99CCFF;">4</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr align="center">
                    <td style="background-color: #99CCFF;">5</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr align="center">
                    <td style="background-color: #99CCFF;">6</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr align="center">
                    <td style="background-color: #99CCFF;">7</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr align="center">
                    <td style="background-color: #99CCFF;">8</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr align="center">
                    <td style="background-color: #99CCFF;">9</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr align="center">
                    <td style="background-color: #99CCFF;">10</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr align="center">
                    <td style="background-color: #99CCFF;">11</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr align="center">
                    <td style="background-color: #99CCFF;">12</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                </tbody>
            </table>
        </div>
        <!--隐藏的维护记录表结束-->
        <!--隐藏的设备养护记录表格开始-->
        <div class="col-sm-12 select-table table-striped" id="divid_sbyh" style="display: none">
            <table class='table table-hover table-bordered' cellpadding='0' border='1' cellspacing='0'
                   style="width: 700px">
                <thead style='height: 30pt;'>
                <tr style="font-family: 微软雅黑;font-size: 14px">
                    <td align="center" style="background-color: #99CCFF;width: 70px">设备名称</td>
                    <td colspan="2" align="center" style="width: 100px" id="sbmc_yh"></td>
                    <td align="center" style="background-color: #99CCFF;width: 70px">设备编号</td>
                    <td align="center" style="width: 160px" id="sbbh_yh"></td>
                    <td align="center" style="background-color: #99CCFF;width: 100px">放置地点</td>
                    <td colspan="2" align="center" id="bm_yh"></td>
                </tr>
                <tr style="font-family: 微软雅黑;height: 10pt">
                    <th colspan="8"></th>
                </tr>
                </thead>
                <tbody id="tbody_yh" style='height: 22pt;font-family: 微软雅黑;'>
                </tbody>
            </table>
        </div>
        <!--隐藏的设备养护记录表格结束-->
    </div>
</div>
<div><input type="hidden" id="_pageNumber"></div>
<div><input type="hidden" id="_pageSize"></div>


<!--<p>[[${url}]]</p>-->
<th:block th:include="include :: footer"/>
<!--<th:block th:include="include :: bootstrap-select-js"/>-->
<!--<th:block th:include="include :: jasny-bootstrap-js"/>-->
<!--<th:block th:include="include :: datetimepicker-js"/>-->
<!--<script th:src="@{/ruoyi/js/jquery.cookie.js}"></script>-->
<script th:src="@{/ruoyi/js/jquery-confirm.min.js}"></script>
<!--<script src='http://192.168.0.58:8000/CLodopfuncs.js'></script>-->
<!--<script src='http://192.168.0.58:18000/CLodopfuncs.js'></script>-->
<script th:src="@{/ruoyi/js/jquery.form.js}"></script>
<!--<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>-->
<!--<script type="text/javascript" th:src="@{/js/zzsc.js}"></script>-->
<script th:inline="javascript">
    // 下面这行和上面的script一起使用  获取真实IP地址
    // document.write(returnCitySN["cip"]+','+returnCitySN["cname"] + "真实IP地址")
    // document.write()
    // var url="http://"+returnCitySN["cip"]+':9090'
    // // 下面的一堆 单独使用 获取本地的IP地址
    // function findIP(callback) {
    //     var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection; //compatibility for firefox and chrome
    //     var pc = new myPeerConnection({iceServers: []}),
    //         noop = function() {},
    //         localIPs = {},
    //         ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g,
    //         key;
    //
    //     function ipIterate(ip) {
    //         if (!localIPs[ip]) callback(ip);
    //         localIPs[ip] = true;
    //     }
    //     pc.createDataChannel("");
    //     pc.createOffer().then(function(sdp) {
    //         sdp.sdp.split('\n').forEach(function(line) {
    //             if (line.indexOf('candidate') < 0) return;
    //             line.match(ipRegex).forEach(ipIterate);
    //         });
    //         pc.setLocalDescription(sdp, noop, noop);
    //     });
    //     pc.onicecandidate = function(ice) {
    //         if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return;
    //         ice.candidate.candidate.match(ipRegex).forEach(ipIterate);
    //     };
    // }
    //
    // findIP(function(ip){
    //     let dom = document.getElementById('dom')
    //     dom.innerHTML = ip + "你的本地IP地址"
    // });

    var selections = [];
    var LODOP; //声明为全局变量
    // var now = getNow();
    // watermark({"watermark_txt": "海 王 国 安" + now});
    var sessionname = [[${session.username}]]
    var gsid = [[${session.gsid}]]
    //打开网页加载bootstrap-table数据
    $(document).ready(function () {
//      设置模态框居中
//         $('#sbAddModal').on('shown.bs.modal', function (e) {
// // 关键代码，如没将modal设置为 block，则$modala_dialog.height() 为零
//             $(this).css('display', 'block');
//             var modalHeight=$(window).height() / 2 - $('#sbAddModal .modal-dialog').height() / 2;
//             $(this).find('.modal-dialog').css({
//                 'margin-top': modalHeight
//             });
//         });
        $("#dengmz").val(sessionname)
        if (gsid == null) {
            $.alert("当前状态未登陆系统或浏览器中当前会话结束了，您需要重新登陆","温馨提示")
            window.location.href = "/login";
        }
        $("#gsids").val(gsid)
        initUserTable();

        yctable()

        $.ajax({
            url: '/sbgl/sbflb/getsbflb/' + gsid,
            type: 'get',
            async: false,
            success: function (data) {
                $("#sbmc_sel").empty();
                var options = "";   //字符串拼接
                $("#sbmc_sel").append('<option value="GASB-">请选择打印台账的设备类型</option>');
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].sbid + "'>" + data[i].sbmc + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $("#sbmc_sel").append(options);
            }
        })

        function initUserTable() {
            $("#bootstrap-table").bootstrapTable({
                toolbar: '#toolbar',
                showToggle: true,//是否切换显示
                showColumns: true,//是否显示列，
                showColumnsToggleAll: true,
                // detailView: true,//和下面的属性成对设置，是否显示加号显示详细信息
                // detailFormatter: "detailFormatter",
                showExport: true,//是否导出
                // showPaginationSwitch: true,//切换是否分页显示
                showFooter: true,//是否显示页脚，主要用途是显示汇总的信息
                striped: false,//是否显示行间隔色
                paginationPreText: '上一页',
                paginationNextText: '下一页',
                queryParamsType: '',
                method: 'GET',
                uniqueId: "id",
                exportDataType: "basic", //basic', 'all', 'selected'.
                // exportTypes:['Excel'],  //导出文件类型
                pageNumber: 'form' ? 1 : parseInt($('#_pageNumber').val()),
                pagination: true,//是否分页
                sidePagination: 'server',//server:服务器端分页|client：前端分页
                pageSize: 'form' ? 10 : parseInt($('#_pageSize').val()),//单页记录数
                pageList: [10, 20, 30, 'ALL'],//可选择单页记录数
                showRefresh: true,//刷新按钮
                queryParams: queryParams,
                // onDblClickRow: function (row,index) {
                //     console.log(index[0])
                // },
                onDblClickRow: function (row, tr, flied) {
                    tr.addClass("selected")
                    // alert(row.bfbs)
                    tr.attr("checked", true)
                },

                url: "/sbgl/sbxxb/getsblist/",
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'no',
                        title: '序号',
                        align: "center",
                        width: 60,
                        // formatter: function (value, row, index) {
                        //     //获取每页显示的数量
                        //     var pageSize = $('#bootstrap-table').bootstrapTable('getOptions').pageSize;
                        //     //获取当前是第几页
                        //     var pageNumber = $('#bootstrap-table').bootstrapTable('getOptions').pageNumber;
                        //     //返回序号，注意index是从0开始的，所以要加上1
                        //     return pageSize * (pageNumber - 1) + index + 1;
                        // }
                        formatter: function (value, row, index) {
                            return index + 1;
                        }
                    },
                    {
                        field: 'sbbh',
                        title: '设备编码'
                    },
                    {
                        field: 'sbmc',
                        title: '设备名称'
                    },
                    {
                        field: 'guige',
                        title: '品牌型号',
                        // sortable: true,
                    },
                    {
                        field: 'bm',
                        title: '部门'
                    },
                    {
                        field: 'shiyr',
                        title: '设备使用人'
                    },
                    {
                        field: 'bfbs',
                        title: '是否报废',
                        align: 'center',
                        formatter: function (value, row, index) {
                            return statusTools(row);
                        }
                    },
                    {
                        title: '操作',
                        align: 'center',
                        formatter: function (value, row, index) {
                            // var actions = [];
                            // actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="updatetjmtk(row.id)" data-toggle="modal" data-target="#myModal5"><i class="fa fa-edit"></i>编辑</a> ');
                            // actions.push('<a class="btn btn-danger btn-xs " href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
                            // // actions.push('<a class="btn btn-info btn-xs " href="javascript:void(0)" onclick="resetPwd(\'' + row.userId + '\')"><i class="fa fa-key"></i>重置</a>');
                            // return actions.join('');
                            var id = index;
                            var data = JSON.stringify(row);
                            var result = "";
                            var bfbs = (row.bfbs)
                            if (bfbs == "1") {
                                result += "<a href='javascript:;' class='btn btn-xs green' onclick=\"webpageById('" + row + "','" + id + "')\" title='查看'><span class='glyphicon glyphicon-search'></span></a>";
                                return result;
                            } else {
                                result += "<a href='javascript:;' class='btn btn-xs green' onclick=\"webpageById('" + row + "','" + id + "')\" title='查看'><span class='glyphicon glyphicon-search'></span></a>";
                                result += "<a href='javascript:;' class='btn btn-xs blue'  onclick=\"EditViewById('" + row + "','" + id + "')\" title='生成二维码'><span class='glyphicon glyphicon-qrcode'></span></a>";
                                result += "<a href='javascript:;' class='btn btn-xs red'   onclick=\"DeleteByIds('" + row + "','" + id + "')\" title='修改' id=''><span class='glyphicon glyphicon-pencil'></span></a>";
                                result += "<a href='javascript:;' class='btn btn-xs blue'  onclick=\"DydjbById('" + row + "','" + id + "')\" title='打印登录表'><span class='glyphicon glyphicon-print'></span></a>";
                                return result;
                            }
                        }
                    }]
            })
        }
    });

    function dywhjl() {
        window.location.href = "/whjldy"
    }

    /* 用户状态显示 */
    function statusTools(row) {
        if (row.bfbs == 1) {
            return '<i class=\"fa fa-toggle-on text-danger fa-2x\"></i> ';
        } else {
            return '<i class=\"fa fa-toggle-off  text-muted fa-2x\"></i> ';
        }
    }

    //查询按钮事件
    $('#search_btn').click(function () {
        $('#bootstrap-table').bootstrapTable('refresh', {
            url: '/sbgl/sbxxb/getsblist/'
        });
    });

    var tj_qrcode = new QRCode(document.getElementById("tj_qrcode"), {
        width: 100,
        height: 100
    });

    function makeqrcode() {
        var elText = document.getElementById("tj_text");
        tj_qrcode.makeCode(elText.value);
    }

    makeqrcode()

    function sbbhsc() {
        var sb = $("#sbbh_sel option:selected").val();
        var sbmc = $("#sbbh_sel option:selected").text();
        var sbbh = "";
        $.ajax({
            url: "/sbgl/sbflb/maxbh/" + sb,
            type: 'GET',
            async: false,
            success: function (data) {
                $("#sbbh_id").val(data);
                $("#sbmc_id").val(sbmc);
            },
        })
        $('#tj_text').val('http://' + geturl() + ':9090/sbgl/sbxxb/sbwh/' + $("#sbbh_id").val() + '/');
        makeqrcode();
        // var sbbh = obj.getAttribute("value");
        var tj_qrcode = document.getElementById("tj_qrcode").lastElementChild.outerHTML;
        $("#tj_qrcode_update_input_15").val(tj_qrcode);
    }

    // //点击生成设备编号后的js
    // $('#creat_sbbh_btn').click(function () {
    //     var sb = $("#sbbh_sel option:selected").val();
    //     var sbmc = $("#sbbh_sel option:selected").text();
    //     var sbbh = "";
    //     $.ajax({
    //         url: "/sbgl/sbflb/maxbh/" + sb,
    //         type: 'GET',
    //         async: false,
    //         success: function (data) {
    //             $("#sbbh_id").val(data);
    //             $("#sbmc_id").val(sbmc);
    //         },
    //     })
    //     $('#tj_text').val('http://'+geturl()+':9090/sbgl/sbxxb/sbwh/' + $("#sbbh_id").val() + '/');
    //     makeqrcode();
    //     // var sbbh = obj.getAttribute("value");
    //     var tj_qrcode = document.getElementById("tj_qrcode").lastElementChild.outerHTML;
    //     $("#tj_qrcode_update_input_15").val(tj_qrcode);
    // });

    $("#button-open-4").click(function () {
        $.modal.open('添加用户', "/form", '900', '500', callback);
    })

    function callback(index, layero) {
        $.alert("进入了回调函数提交方法","温馨提示");
        $.ajax({
            url: "/nc/sysNc/insertspkfk",
            type: 'POST',
            data: $("#form-user-add form").serialize(),
            success: function (result) {
                if (result != null) {
                    $.alert("添加成功！！！","温馨提示");
                }
            }
        });
    }

    function getIdSelections() {
        return $.map($('#bootstrap-table').bootstrapTable('getSelections'), function (row) {
            return row.id
        })
    }

    function getsbbhSelections() {
        return $.map($('#bootstrap-table').bootstrapTable('getSelections'), function (row) {
            return row.sbbh
        })
    }

    //多个删除
    function remove() {
        var ids = getIdSelections();
        var wents = getwentSelections();
        if (confirm("确认删除【" + wents + "】吗？？？")) {
            $.ajax({
                url: "/nc/sysNc/deleteallspkfk/" + ids,
                type: 'DELETE',
                success: function (result) {
                    if (result != null) {
                        confirm("温馨提示","删除成功！！！")
                        window.location.href = window.location.href;
                    }
                },
            });
        }
    }

    function responseHandler(res) {

        $.each(res.rows, function (i, row) {
            row.state = $.inArray(row.id, selections) !== -1
        })
        return res
    }

    function getshiyr() {
        var shiyr = $("#shiyr_id").val();
        var bm = $("#bmid_id option:selected").text();
        var xinshiyr = ""
        $.ajax({
            url: "/sbgl/ygxxb/getbmbyshiyrandbm/" + shiyr + "/" + bm+"/"+gsid,
            type: "get",
            async: false,
            success: function (data) {
                xinshiyr = data
            }
        })
        return xinshiyr;
    }

    function geturl() {
        var geturl = ""
        $.ajax({
            url: "/geturl",
            type: "get",
            async: false,
            success: function (data) {
                geturl = data
            }
        })
        // alert(geturl)
        return $.trim(geturl);
    }

    function queryParams(params) {
        var param = {
            limit: params.limit, // 页面大小
            offset: params.offset, // 页码
            nextPage: params.pageNumber,
            pageNumber: params.pageNumber,
            pageSize: params.pageSize,
            sbbh: $("#sbbh").val(),
            gsid: gsid,
            bfbs: $("#is_bf").val(),

        };
        return param;
    }

    function detailFormatter(index, row) {
        var html = []
        $.each(row, function (key, value) {
            html.push('<p><b>' + key + ':</b> ' + value + '</p>')
        })
        return html.join('')
    }

    function yctable() {
        $('#tbody_id').empty();
        // //隐藏的table,显示按设备名称，生成
        var sbmc = $('#sbmc_sel option:selected').val()
        var sbhz = $('#sbmc_sel option:selected').text()
        if (sbhz.indexOf("脑") > 0 || sbhz.indexOf("务器") > 0) {
            document.getElementById("yc_zbxh").style.display = ""
            document.getElementById("yc_cpuxh").style.display = ""
            document.getElementById("yc_ncdx").style.display = ""
            document.getElementById("yc_ypdx").style.display = ""
            document.getElementById("yc_xsqdx").style.display = ""
            document.getElementById("yc_ipdz").style.display = ""
            document.getElementById("yc_maxdz").style.display = ""
            $.ajax({
                url: "/sbgl/sbxxb/getsbwh/" + sbmc + "/" + gsid,
                type: 'GET',
                success: function (data) {
                    // $('#tableid_sbtz').empty();
                    var tables = "";   //字符串拼接
                    var j = 0;
                    for (var i in data) {  //遍历json数组
                        var ip = data[i].ipdz
                        if (ip == "") {
                            var ipdz = "<td align='center' style='width: 5.8mm'>" + '' + "</td>"
                        } else {
                            var ipdz = "<td align='center' style='width: 5.8mm'>" + data[i].ipdz.split('.')[3] + "</td>"
                        }
                        j = parseInt(i) + 1;
                        tables = "<tr style='font-family: 微软雅黑;font-size: 9px;height: 30px'>"
                            + "<td align='center' style='width: 9.5mm;'>" + j + "</td>"
                            + "<td align='center' style='width: 18mm;'>" + data[i].sbbh + "</td>"
                            + "<td align='center' style='width: 15.9mm;'>" + data[i].sbmc + "</td>"
                            // + "<td align='center' style='width: 19.3mm;'>" + data[i].guige + "</td>"
                            + "<td align='center' style='width: 30mm;'>" + data[i].zbxh + "</td>"
                            + "<td align='center' style='width: 15mm;'>" + data[i].cpuxh + "</td>"
                            + "<td align='center' style='width: 9.5mm;'>" + data[i].ncggdx + "</td>"
                            + "<td align='center' style='width: 20.3mm;'>" + data[i].ypdx + "</td>"
                            + "<td align='center' style='width: 15.2mm;'>" + data[i].xsqppcc + "</td>"
                            + "<td align='center' style='width: 9.5mm;'>" + data[i].dw + "</td>"
                            + "<td align='center' style='width: 9.5mm;'>" + data[i].shul + "</td>"
                            + "<td align='center' style='width: 15.9mm;'>" + data[i].shccj + "</td>"
                            + "<td align='center' style='width: 16.6mm;'>" + data[i].gmrq + "</td>"
                            + (ipdz ? ipdz : '')
                            + "<td align='center' style='width: 25.2mm;'>" + data[i].macdz + "</td>"
                            + "<td align='center' style='width: 15mm;'>" + data[i].bm + "</td>"
                            + "<td align='center' style='width: 19.3mm;'>" + data[i].shiyr + "</td>"
                            + "<td align='center' style='width: 24mm;'>" + data[i].beiz + "</td>"
                            + "</tr>";
                        $('#tableid_sbtz').append(tables);
                    }
                }
            })
        } else if (sbhz.indexOf("脑") < 0 && sbhz.indexOf("务器") < 0) {
            document.getElementById("yc_zbxh").style.display = "none"
            document.getElementById("yc_cpuxh").style.display = "none"
            document.getElementById("yc_ncdx").style.display = "none"
            document.getElementById("yc_ypdx").style.display = "none"
            document.getElementById("yc_xsqdx").style.display = "none"
            document.getElementById("yc_ipdz").style.display = "none"
            document.getElementById("yc_maxdz").style.display = "none"
            $.ajax({
                url: "/sbgl/sbxxb/getsbwh/" + sbmc + "/" + gsid,
                type: 'GET',
                success: function (data) {
                    // $('#tableid_sbtz').empty();
                    var tables = "";   //字符串拼接
                    var j = 0;
                    for (var i in data) {  //遍历json数组
                        j = parseInt(i) + 1;
                        tables = "<tr style='font-family: 微软雅黑;font-size: 9px;height: 30px'>"
                            + "<td align='center' style='width: 10mm;'>" + j + "</td>"
                            + "<td align='center' style='width: 25mm;'>" + data[i].sbbh + "</td>"
                            + "<td align='center' style='width: 24mm;'>" + data[i].sbmc + "</td>"
                            + "<td align='center' style='width: 50mm;'>" + data[i].guige + "</td>"
                            + "<td align='center' style='width: 15mm'>" + data[i].dw + "</td>"
                            + "<td align='center' style='width: 15mm'>" + data[i].shul + "</td>"
                            + "<td align='center' style='width: 25mm'>" + data[i].shccj + "</td>"
                            + "<td align='center' style='width: 26mm'>" + data[i].gmrq + "</td>"
                            + "<td align='center' style='width: 50mm'>" + data[i].beiz + "</td>"
                            + "<td align='center' style='width: 22mm;'>" + data[i].bm + "</td>"
                            + "<td align='center' style='width: 18mm'>" + data[i].shiyr + "</td>"
                            + "</tr>";
                        $('#tableid_sbtz').append(tables);
                    }
                }
            })
        }
    }

    //打印设备台账开始
    function Mysbtz() {
        var sbmc = $('#sbmc_sel option:selected').val()
        if (sbmc == "GASB-") {
            $.alert("请选择打印台账的设备类型","温馨提示")
        } else {
            var options = $('#divid_sbtz').html();
            var miaos="计算机设施设备管理台帐";
            LODOP = getLodop();
            LODOP.PRINT_INIT("");
            LODOP.ADD_PRINT_TEXT(15, 300, 250, 30, getwhxx(miaos)==""?"计算机设施设备管理台帐":getwhxx(miaos)[0].whmc);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            LODOP.SET_PRINT_STYLEA(0, "bold", 1);
            LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
            LODOP.SET_PRINT_STYLEA(0, "Horient", 2);

            LODOP.ADD_PRINT_TEXT(38, 650, 180, 21, getwhxx(miaos)==""?"":getwhxx(miaos)[0].wenh);
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
            LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
            LODOP.SET_PRINT_STYLEA(0, "Horient", 1);
            LODOP.SET_PRINT_STYLEA(0, "bold", 1);
            LODOP.ADD_PRINT_TABLE(55, 5, 2970, 2100, options);
            LODOP.PREVIEW();
        }
    };

    function cxsysj() {
        $.alert("执行了","温馨提示");
    }

    //打印设备台账结束

    function webpageById(row, index) {
        var data = JSON.stringify($("#bootstrap-table").bootstrapTable('getData'));
        var data_json = JSON.parse(data);
        window.location.href = "/sbgl/sbxxb/sbwh/" + data_json[index].sbbh + '/';
    }

    function updatesb() {
        var sbbh = $('#sbbh_update').val()
        var sbmc = $('#sbmc_update').val()
        var ipdz1 = $("#ipdz1_update").val()
        var ipdz2 = $("#ipdz2_update").val()
        var ipdz3 = $("#ipdz3_update").val()
        var ipdz4 = $("#ipdz4_update").val()
        var macdz1 = $(".mac1update").val()
        var macdz2 = $(".mac2update").val()
        var macdz3 = $(".mac3update").val()
        var macdz4 = $(".mac4update").val()
        var macdz5 = $(".mac5update").val()
        var macdz6 = $(".mac6update").val()
        var xinr = ""
        if (sbmc.indexOf("脑") > 0 || sbmc.indexOf("务器") > 0) {
            if (ipdz1 == "" || ipdz2 == "" || ipdz3 == "" || ipdz4 == "") {
                $.alert("IP地址错误，请检查","温馨提示")
            } else if (macdz1.length != 2 || macdz2.length != 2 || macdz3.length != 2 || macdz4.length != 2 || macdz5.length != 2 || macdz6.length != 2) {
                $.alert("MAC地址错误，请检查","温馨提示")
            } else if (xinr == "全公司上下查无此人") {
                $.alert("在该部门中未找到该人员请核对后，重新输入","温馨提示")
            } else {
                tishi(sbbh)
            }
        } else {
            tishi(sbbh)
        }
    }

    function tishi(sbbh) {
        $.confirm({
            title: '温馨提示',
            content: '更新设备表吗？？？',
            buttons: {
                确定: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        return $.ajax({
                            url: '/sbgl/sbxxb/updatesb/'+ sbbh,
                            method: 'PUT',
                            data: $("#sbupdateModal form").serialize()
                        }).done(function (response) {
                            $("#sbupdateModal").modal('hide');
                            $.alert("更新成功","温馨提示")
                            refresh()
                        }).fail(function () {
                        });
                    }
                },
                取消: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                    },
                },
            },
        });
    }

    function refresh() {
        var pageSize = $('#bootstrap-table').bootstrapTable('getOptions').pageSize;
        //获取当前是第几页
        var pageNumber = $('#bootstrap-table').bootstrapTable('getOptions').pageNumber;
        $("#_pageNumber").val(pageNumber)
        $("#_pageSize").val(pageSize)
        $('#bootstrap-table').bootstrapTable('refresh', {
            pageNumber: pageNumber,
            pageSize: pageSize
        });
    }

    // 清除第二次打开模态框显示上次打开的记录
    $('#sbupdateModal').on('hide.bs.modal', function () {
        $('#sbupdateModal input').val("")
        $('#sbupdateModal input').removeAttr("readonly")
        var list = document.getElementById('form-sb-update')
        //设置文字的颜色
        // list.style.cssText="color:green"
    })


    function DeleteByIds(row, index) {
        var data = JSON.stringify($("#bootstrap-table").bootstrapTable('getData'));
        var data_json = JSON.parse(data);
        if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) { //移动端
            $.ajax({
                url: "/sbgl/sbxxb/xiu/" + data_json[index].id,
                type: 'GET',
                async: false,
                success: function (data) {
                    window.location.href = "/xiugai"
                },
            })
        } else {
            $("#sbupdateModal").modal({
                backdrop: "static"
            });
            getDepts("#sbupdateModal select");
            $('#gsid_update').val(data_json[index].gsid)
            $('#gsid_update').attr("readOnly", "readOnly")
            $('#sbmc_update').val(data_json[index].sbmc)
            $('#sbmc_update').attr("readOnly", "readOnly")
            $('#sbbh_update').val(data_json[index].sbbh)
            $('#sbbh_update').attr("readOnly", "readOnly")
            var sbmc = $('#sbmc_update').val();
            // var list = document.getElementById('form-sb-update')
            // //设置文字的颜色
            // list.style.cssText="color:green"

            document.getElementById('guige_update').style.color = "#676a6c"
            document.getElementById('shccj_update').style.color = "#676a6c"
            document.getElementById('zbxh_update').style.color = "#676a6c"
            document.getElementById('cpuxh_update').style.color = "#676a6c"
            document.getElementById('ncggdx_update').style.color = "#676a6c"
            document.getElementById('ypdx_update_1').style.color = "#676a6c"
            document.getElementById('ypdx_update_2').style.color = "#676a6c"
            document.getElementById('ypdx_update_3').style.color = "#676a6c"
            document.getElementById('xsqppcc_update').style.color = "#676a6c"
            document.getElementById('gmrq_update').style.color = "#676a6c"
            document.getElementById('ipdz_update').style.color = "#676a6c"
            document.getElementById('macdz_update').style.color = "#676a6c"
            document.getElementById('bmid_update').style.color = "#676a6c"
            document.getElementById('shiyr_update').style.color = "#676a6c"
            document.getElementById('beiz_update').style.color = "#676a6c"
            document.getElementById("ypdx1lab").style.color = "#676a6c";
            document.getElementById("ypdx2lab").style.color = "#676a6c";
            document.getElementById("ypdx3lab").style.color = "#676a6c";
            document.getElementById("xkxh_update").style.color = "#676a6c";
            document.getElementById("xsqgmrq_update").style.color = "#676a6c";
            document.getElementById("sjbeiz_update").style.color = "#676a6c";
            document.getElementById("bfbeiz_update").style.color = "#676a6c";
            if (sbmc.indexOf("脑") > 0 || sbmc.indexOf("务器") > 0) {
                $('#guige_update').val(data_json[index].guige)
                $('#shccj_update').val(data_json[index].shccj)
                $('#zbxh_update').val(data_json[index].zbxh)
                $('#cpuxh_update').val(data_json[index].cpuxh)
                var ncggdx = data_json[index].ncggdx.split(" ")
                $('#ncggdx_update').val(ncggdx[0])
                var ypdx = data_json[index].ypdx.split("+")
                $('#ypdx_update_1').val(ypdx[0])
                $('#ypdx_update_2').val(ypdx[1])
                $('#ypdx_update_3').val(ypdx[2])
                $('#xsqppcc_update').val(data_json[index].xsqppcc)
                $('#xkxh_update').val(data_json[index].xkxh)
                $('#gmrq_update').val(data_json[index].gmrq)
                $('#ipdz_update').val(data_json[index].ipdz)
                var ipslit = data_json[index].ipdz.split(".")
                $('#ipdz_update >.ip1').val(ipslit[0])
                $('#ipdz_update >.ip2').val(ipslit[1])
                $('#ipdz_update >.ip3').val(ipslit[2])
                $('#ipdz_update >.ip4').val(ipslit[3])
                $('#ipupdate').val(data_json[index].ipdz)
                $('#macdz_update').val(data_json[index].macdz)
                var macsplit = data_json[index].macdz.split("-")
                $('#macdz_update >.mac1update').val(macsplit[0])
                $('#macdz_update >.mac2update').val(macsplit[1])
                $('#macdz_update >.mac3update').val(macsplit[2])
                $('#macdz_update >.mac4update').val(macsplit[3])
                $('#macdz_update >.mac5update').val(macsplit[4])
                $('#macdz_update >.mac6update').val(macsplit[5])
                $('#macupdate').val(data_json[index].macdz)
                $('#bmid_update').val(data_json[index].bm)
                $('#shiyr_update').val(data_json[index].shiyr)
                $('#beiz_update').val(data_json[index].beiz)
                $('#xsqgmrq_update').val(data_json[index].xsqgmrq)
                $('#sjbeiz_update').val(data_json[index].sjbeiz)
                $('#bfbeiz_update').val(data_json[index].bfbeiz)
            } else {
                $('#guige_update').val(data_json[index].guige)
                $('#shccj_update').val(data_json[index].shccj)
                $('#gmrq_update').val(data_json[index].gmrq)
                $('#bmid_update').val(data_json[index].bm)
                $('#shiyr_update').val(data_json[index].shiyr)
                $('#beiz_update').val(data_json[index].beiz)
                $('#xsqgmrq_update').val(data_json[index].xsqgmrq)
                $('#sjbeiz_update').val(data_json[index].sjbeiz)
                $('#bfbeiz_update').val(data_json[index].bfbeiz)
                $('#zbxh_update').attr("readOnly", "readOnly")
                $('#cpuxh_update').attr("readOnly", "readOnly")
                $('#ncggdx_update').attr("readOnly", "readOnly")
                $('#xkxh_update').attr("readOnly", "readOnly")
                $('#ypdx_update_1').attr("readOnly", "readOnly")
                $('#ypdx_update_2').attr("readOnly", "readOnly")
                $('#ypdx_update_3').attr("readOnly", "readOnly")
                $('#xsqppcc_update').attr("readOnly", "readOnly")
                $('#ipdz_update input').attr("readOnly", "readOnly")
                $('#macdz_update input').attr("readOnly", "readOnly")
            }
        }
    }

    var qrcode = new QRCode(document.getElementById("qrcode"), {
        width: 100,
        height: 100
    });

    //生成二维码js开始
    function EditViewById(row, index) {
        //$('.edittosummernote').summernote('destroy');
        var data = JSON.stringify($("#bootstrap-table").bootstrapTable('getData')); //获取全部数据
        var data_json = JSON.parse(data); //data_json和data_json2一样都是json对象
        var data_json2 = eval("(" + data + ")");
        $('#text').val('http://' + geturl() + ':9090/sbgl/sbxxb/sbwh/' + data_json[index].sbbh + '/');
        // //由于data2已经是对象了，alert不能显示对象只能显示为[object Object],需要控制台打印
        // //根据index找到对应行数据，填充数据到修改模态框
        // $("#id_update_static_15").val(data_json[index].id);
        // $("#mkmc_update_input_15").val(data_json[index].mkmc);
        // $("#went_update_input_15").val(data_json[index].went);
        // $("#yuany_update_input_15").val(data_json[index].yuany);
        // // $("#jjbz_update_input_15").val(data_json[index].jjbz);
        //
        // $('.edittosummernote').html($(".edittosummernote").val(data_json[index].jjbz).val());
        // $('.edittosummernote').summernote({focus: true});
        // $("#emp_update_btn").val(data_json[index].id);
        // //弹出修改模态框，非新增模态框
        // $('#myModal5').modal('show')

        // $('.edittosummernote').html($('#text').val('http://localhost:9090/nc/sbxxb/sbxx/' + data_json[index].sbbh));
        // $('.edittosummernote').summernote({好，那我们来我看下啊，55 15 15。那我想问一下。是？
        //     callbacks: {
        //         onInit: function () {
        //             var elText = document.getElementById("text");
        //             qrcode.makeCode(elText.value);
        //             // alert(window.screenY);
        //         }
        //     }
        // });

        $("#emp_save_btn").val(data_json[index].sbbh);
        makecode();
        $('#empAddModal').modal('show');
    }

    function makecode() {
        var elText = document.getElementById("text");
        qrcode.makeCode(elText.value);
        // alert(document.getElementById("qrcode").lastElementChild.outerHTML);
    }

    //生成二维码js结束
    function updatespkfk(obj) {
        var sbbh = obj.getAttribute("value");
        var qrcode = document.getElementById("qrcode").lastElementChild.outerHTML;
        $("#qrcode_update_input_15").val(qrcode);
        $.ajax({
            url: "/sbgl/sbxxb/editspkfk/" + sbbh,
            type: 'PUT',
            data: $("#empAddModal form").serialize(),
            success: function (result) {
                if (result != null) {
                    $("#empAddModal").modal('hide');
                    refresh()
                }
            }
        });
    };

    //打印设备标签二维码开始
    function MyPreview() {
        var column = $('#bootstrap-table').bootstrapTable('getSelections');
        var options = "";
        LODOP = getLodop();
        LODOP.PRINT_INIT("");
        var iCurLine = 20;
        for (var i = 0; i < column.length; i++) {  //遍历json数组
            options = "<table class='table table-hover table-bordered' cellpadding='0' border='1' cellspacing='0'>"
                + "<tr><td colspan='2'><div align='center' style='font-family: 微软雅黑;font-size: 12pt'>安徽海王国安医药有限公司</div></td><td rowspan='4' align='center' style='width: 110px;height: 110px;'>" + column[i].qrcode + "</td></tr>"
                + "<tr><td colspan='2'><div align='center' style='font-size: 12pt;font-family: 微软雅黑'>固定资产管理标签</div></td></tr>"
                + "<tr><td style='width:90px'><div align='center' style='font-family: 微软雅黑;font-size: 12pt'>资产编号</div></td><td style='width: 160px'><div align='center'><strong style='font-size: 14pt;font-family: 微软雅黑'>" + column[i].sbbh + "</strong></div></td></tr>"
                + "<tr><td style='width:90px'><div align='center' style='font-size: 12pt;font-family: 微软雅黑'>资产名称</div></td><td style='width: 160px'><div align='center'><strong style='font-family: 微软雅黑;font-size: 14pt'>" + column[i].sbmc + "</strong></div></td></tr>"
                + "</table>";
            if (i % 2 == 1) {
                LODOP.ADD_PRINT_TABLE(iCurLine, 385, 380, 20, options);
                iCurLine += 130;
            } else {
                LODOP.ADD_PRINT_TABLE(iCurLine, 5, 380, 20, options);
            }
        }
        // $('#divid').append(options);
        LODOP.PREVIEW();
    };

    //打印设备标签二维码开始
    function gettjmtk() {
        $("#sbbh_sel").val("")
        $("#sbbh_id").val("")
        $("#sbmc_id").val("")
        $("#guige_id").val("")
        $("#shccj_id").val("")
        $("#gmrq_id").val("")
        $("#bmid_id").val("")
        $("#shiyr_id").val("")
        $('#zbxh_id').val("")
        $('#cpuxh_id').val("")
        $('#ncggdx_id').val("")
        $('#xkxh_id').val("")
        $('#ypdx_id_1').val("")
        $('#ypdx_id_2').val("")
        $('#ypdx_id_3').val("")
        $('#xsqppcc_id').val("")
        $('#ipdz1').val("")
        $('#ipdz2').val("")
        $('#ipdz3').val("")
        $('#ipdz4').val("")
        $("#ip").val("");
        $("#mac").val("");
        $('.mac1').val("");
        $('.mac2').val("");
        $('.mac3').val("");
        $('.mac4').val("");
        $('.mac5').val("");
        $('.mac6').val("");
        $('#beiz_id').val("");
        $("#sbAddModal").modal({
            backdrop: "static"
        });
        $("#gsidfrotj").val(gsid)
        getDepts("#bmid_id");
        getsblx("#sbbh_sel");
        getxsqpp();
        $('#ypdx_btn_1').attr("disabled", "disabled").unbind("click")
        $('#ypdx_btn_2').attr("disabled", "disabled").unbind("click")
        $('#ypdx_btn_3').attr("disabled", "disabled").unbind("click")
        $('#xsqcc_btn').attr("disabled", "disabled").unbind("click")
        $('#creat_sbbh_btn').attr("disabled", "disabled").unbind("click")
        document.getElementById('xsqppcc_id').style.backgroundColor = "#ffffff"
    };

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#gmrq_id',
                type: 'date',
                trigger: 'click'
            });
        });
    });

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#gmrq_update',
                type: 'date',
                trigger: 'click'
            });
        });
    });

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#xsqgmrq_update',
                type: 'date',
                trigger: 'click'
            });
        });
    });

    $("#guige_update").bind("input propertychange", function () {
        document.getElementById("guige_update").style.color = "red"
    });

    $("#shccj_update").bind("input propertychange", function () {
        document.getElementById("shccj_update").style.color = "red"
    });

    $("#gmrq_update").bind("input propertychange", function () {
        document.getElementById("gmrq_update").style.color = "red"
    });

    $("#zbxh_update").bind("input propertychange", function () {
        document.getElementById("zbxh_update").style.color = "red"
    });

    $("#cpuxh_update").bind("input propertychange", function () {
        document.getElementById("cpuxh_update").style.color = "red"
    });

    $("#xsqppcc_update").bind("input propertychange", function () {
        document.getElementById("xsqppcc_update").style.color = "red"
    });

    $("#xkxh_update").bind("input propertychange", function () {
        document.getElementById("xkxh_update").style.color = "red"
    });

    $("#bmid_update").bind("input propertychange", function () {
        document.getElementById("bmid_update").style.color = "red"
    });

    $('#bmid_update').change(function () {
        // getDepts("#myModal5 select")
        var bmid = $("#bmid_update option:selected").val();
        $('#shiyr_update').val("");
        $('#browsers_update').empty();
        $("#shiyr_update").removeAttr("readonly")
        $.ajax({
            url: "/sbgl/ygxxb/getygxx/" + bmid + "/" + gsid,
            type: 'get',
            success: function (data) {
                $('#shiyr_update').empty();
                var options = "";   //字符串拼接
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].shiyr + "'>" + data[i].zjm + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $('#browsers_update').append(options);
            },
        });
    });

    $("#shiyr_update").bind("input propertychange", function () {
        document.getElementById("shiyr_update").style.color = "red"
    });

    $("#ncggdx_update").bind("input propertychange", function () {
        document.getElementById("ncggdx_update").style.color = "red"
    });

    $("#ypdx_update_1").bind("input propertychange", function () {
        document.getElementById("ypdx_update_1").style.color = "red"
        if ($("#ypdx_update_1").val() == "") {
            document.getElementById("ypdx1lab").style.color = "red";
        }
    });

    $("#ypdx_update_2").bind("input propertychange", function () {
        document.getElementById("ypdx_update_2").style.color = "red"
        if ($("#ypdx_update_2").val() == "") {
            document.getElementById("ypdx2lab").style.color = "red";
        }
    });

    $("#ypdx_update_3").bind("input propertychange", function () {
        document.getElementById("ypdx_update_3").style.color = "red"
        if ($("#ypdx_update_3").val() == "") {
            document.getElementById("ypdx3lab").style.color = "red";
        }
    });

    $("#beiz_update").bind("input propertychange", function () {
        document.getElementById("beiz_update").style.color = "red"
    });

    $("#bfbeiz_update").bind("input propertychange", function () {
        document.getElementById("bfbeiz_update").style.color = "red"
    });

    $("#sjbeiz_update").bind("input propertychange", function () {
        document.getElementById("sjbeiz_update").style.color = "red"
    });

    $("#xsqgmrq_update").bind("input propertychange", function () {
        document.getElementById("xsqgmrq_update").style.color = "red"
    });

    $("#ipdz_update").bind("input propertychange", function () {
        document.getElementById("ipdz_update").style.color = "red"
    });

    $("#macdz_update").bind("input propertychange", function () {
        document.getElementById("macdz_update").style.color = "red"
    });


    function getsblx(ele) {
        $.ajax({
            url: '/sbgl/sbflb/getsbflb/' + gsid,
            type: 'get',
            async: false,
            success: function (data) {
                $(ele).empty();
                var options = "";   //字符串拼接
                $(ele).append('<option value="">请选择设备类型</option>');
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].sbid + "'>" + data[i].sbmc + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $(ele).append(options);
            }
        })
    }

    function getDepts(ele) {
        $.ajax({
            url: "/sbgl/ygxxb/getbm/" + gsid,
            type: 'get',
            async: false,
            success: function (data) {
                $(ele).empty();
                var options = "";   //字符串拼接
                $(ele).append('<option value="">请选择部门</option>');
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].bm + "'>" + data[i].bm + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $(ele).append(options);
            },
        });
    };

    function getxsqpp() {
        $('#xsqpp_id').val("");
        $('#browsersforxsq').empty();
        $.ajax({
            url: "/sbgl/xsqxxb/getxsqxxb/",
            type: 'get',
            async: false,
            success: function (data) {
                $('#xsqpp_id').empty();
                var options = "";   //字符串拼接
                // $("#browsersforxsq").append('<option value="">请选择显示器品牌</option>');
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].xsqpp + "'>" + data[i].zjm + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $('#browsersforxsq').append(options);
            },
        });
    };

    $('#sbmc_sel').change(function () {
        var sbmc = $('#sbmc_sel option:selected').val()
        if (sbmc != "GASB-") {
            yctable()
        } else {
            $.alert("请选择打印台账的设备类型","温馨提示")
        }
    });

    $('#bmid_id').change(function () {
        var bm = $("#bmid_id option:selected").val();
        $('#shiyr_id').val("");
        $('#browsers').empty();
        $.ajax({
            url: "/sbgl/ygxxb/getygxx/" + bm + "/" + gsid,
            type: 'get',
            async: false,
            success: function (data) {
                $('#shiyr_id').empty();
                var options = "";   //字符串拼接
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].shiyr + "'>" + data[i].zjm + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $('#browsers').append(options);
            },
        });
    });

    function getmaxbh() {
        var sbid = $("#sbbh_sel option:selected").val()
        var maxbh = ""
        $.ajax({
            url: "/sbgl/sbflb/maxbhforint/" + sbid + "/" + gsid,
            type: "get",
            async: false,
            success: function (data) {
                maxbh = data
            }
        })
        return maxbh
    }

    function updatesbflb() {
        var sbid = $("#sbbh_sel option:selected").val()
        console.log(sbid)
        $("#maxbh").val(getmaxbh())
        $.ajax({
            url: "/sbgl/sbflb/updatesbflb/" + sbid,
            type: "put",
            async: false,
            data: $("#sbAddModal form").serialize(),
            success: function (data) {
            }
        })
    }

    function savesbenter() {
        if (event.keyCode == 13) {
            savesb()
        }
    }

    function savesb() {
        var sbbh_sel = $("#sbbh_sel").val()
        var ypdx_sel_1 = $("#ypdx_sel_1 option:selected").text();
        var ypdx_sel_2 = $("#ypdx_sel_2 option:selected").text();
        var ypdx_sel_3 = $("#ypdx_sel_3 option:selected").text();
        var sbbh_id = $("#sbbh_id").val()
        var sbmc_id = $("#sbmc_id").val()
        var guige_id = $("#guige_id").val()
        var shccj_id = $("#shccj_id").val()
        var gmrq_id = $("#gmrq_id").val()
        var bmid_id = $("#bmid_id").val()
        var shiyr_id = $("#shiyr_id").val()
        var zbxh_id = $('#zbxh_id').val()
        var cpuxh_id = $('#cpuxh_id').val()
        var ncggdx_id = $('#ncggdx_id').val()
        var xkxh_id = $('#xkxh_id').val()
        var ypdx_id_1 = $('#ypdx_id_1').val()
        var ypdx_id_2 = $('#ypdx_id_2').val()
        var ypdx_id_3 = $('#ypdx_id_3').val()
        var xsqppcc_id = $('#xsqppcc_id').val()
        var gsid = $("#gsidfrotj").val()
        var ipdz1 = $('#ipdz1').val()
        var ipdz2 = $('#ipdz2').val()
        var ipdz3 = $('#ipdz3').val()
        var ipdz4 = $('#ipdz4').val()
        var macdz = $('.mac1').val();
        var index = ypdx_id_1.lastIndexOf("\-");
        var ypdx_id_shuzi_1 = ypdx_id_1.substring(index + 1, ypdx_id_1.length);
        var index = ypdx_id_2.lastIndexOf("\-");
        var ypdx_id_shuzi_2 = ypdx_id_2.substring(index + 1, ypdx_id_2.length);
        var index = ypdx_id_3.lastIndexOf("\-");
        var ypdx_id_shuzi_3 = ypdx_id_3.substring(index + 1, ypdx_id_3.length);
        var xinr = "";
        if (sbbh_sel == "") {
            $("#sbbh_sel").focus()
            $.alert("请先选择设备类型","温馨提示")
        } else if (bmid_id == "") {
            $("#bmid_id").focus()
            $.alert("请点击选择部门的下拉框","温馨提示")
        } else if (gsid == "") {
            $.alert("当前状态未登陆系统或浏览器中当前会话结束了，您需要重新登陆","温馨提示")
            window.location.href = "/login";
        } else if (shiyr_id == "") {
            $("#shiyr_id").focus()
            $.alert("请输入姓名的助记码，助记码为拼音首字母","温馨提示")
        } else if (bmid_id != "" && shiyr_id != "") {
            var xinr = getshiyr()
            if (sbmc_id == "") {
                $.alert("请先选择设备类型后，点击生成设备编号按钮，谢谢您的合作！！！","温馨提示")
            } else if (sbbh_id == "") {
                $.alert("设备编号是自动生成的，点击生成设备编号按钮","温馨提示")
            } else if (guige_id == "") {
                $("#guige_id").focus()
                $.alert("请输入品牌型号","温馨提示")
            } else if (shccj_id == "") {
                $("#shccj_id").focus()
                $.alert("请输入生产厂家","温馨提示")
            } else if (gmrq_id == "") {
                $("#gmrq_id").focus()
                $.alert("请点击购买日期","温馨提示")
            } else if (zbxh_id == "" && sbmc_id.indexOf("脑") > 0) {
                $("#zbxh_id").focus()
                $.alert("请输入主板型号","温馨提示")
            } else if (cpuxh_id == "" && sbmc_id.indexOf("脑") > 0) {
                $("#cpuxh_id").focus()
                $.alert("请输入CPU型号","温馨提示")
            } else if (ncggdx_id == "" && sbmc_id.indexOf("脑") > 0) {
                $("#ncggdx_id").focus()
                $.alert("请输入内存大小","温馨提示")
            } else if (xkxh_id == "" && sbmc_id.indexOf("脑") > 0) {
                $("#xkxh_id").focus()
                $.alert("请输入显卡型号","温馨提示")
            } else if (ypdx_id_1 == "" && sbmc_id.indexOf("脑") > 0) {
                $("#ypdx_id_1").focus()
                $.alert("请输入硬盘大小","温馨提示")
            } else if (xsqppcc_id == "" && sbmc_id.indexOf("脑") > 0) {
                $("#xsqppcc_id").focus()
                $.alert("请输入显示器大小","温馨提示")
            } else if (ipdz1 == "" && sbmc_id.indexOf("脑") > 0) {
                $("#ipdz1").focus()
                $.alert("请输入IP地址","温馨提示")
            } else if (ipdz2 == "" && sbmc_id.indexOf("脑") > 0) {
                $("#ipdz2").focus()
                $.alert("请输入IP地址","温馨提示")
            } else if (ipdz3 == "" && sbmc_id.indexOf("脑") > 0) {
                $("#ipdz3").focus()
                $.alert("请输入IP地址","温馨提示")
            } else if (ipdz4 == "" && sbmc_id.indexOf("脑") > 0) {
                $("#ipdz4").focus()
                $.alert("请输入IP地址","温馨提示")
            } else if (macdz == "" && sbmc_id.indexOf("脑") > 0) {
                $(".mac1").focus()
                $.alert("请输入MAC物理地址","温馨提示")
            } else if (zbxh_id == "" && sbmc_id.indexOf("务器") > 0) {
                $("#zbxh_id").focus()
                $.alert("请输入主板型号","温馨提示")
            } else if (cpuxh_id == "" && sbmc_id.indexOf("务器") > 0) {
                $("#cpuxh_id").focus()
                $.alert("请输入CPU型号","温馨提示")
            } else if (ncggdx_id == "" && sbmc_id.indexOf("务器") > 0) {
                $("#ncggdx_id").focus()
                $.alert("请输入内存大小","温馨提示")
            } else if (xkxh_id == "" && sbmc_id.indexOf("务器") > 0) {
                $("#xkxh_id").focus()
                $.alert("请输入显卡型号","温馨提示")
            } else if (ypdx_id_1 == "" && sbmc_id.indexOf("务器") > 0) {
                $("#ypdx_id_1").focus()
                $.alert("请输入硬盘大小","温馨提示")
            } else if (xsqppcc_id == "" && sbmc_id.indexOf("务器") > 0) {
                $("#xsqppcc_id").focus()
                $.alert("请输入显示器大小","温馨提示")
                // }else if(ipdz_id==""&&sbmc_id.indexOf("务器")>0){
                //     alert("请输入IP地址")
                //     $("#ipdz_id").focus()
                // }else if(macdz_id==""&&sbmc_id.indexOf("务器")>0){
                //     alert("请输入MAC物理地址")
                //     $("#macdz_id").focus()
            } else if (ypdx_id_shuzi_1 >= 50 && ypdx_sel_1 == "T") {
                $("#ypdx_id_1").val("");
                $.alert("硬盘1大小以T为单位，请输入的硬盘大小不能大于50T","温馨提示")
            } else if (ypdx_id_shuzi_1 <= 80 && ypdx_sel_1 == "G") {
                $("#ypdx_id_1").val("");
                $.alert("硬盘1大小以G为单位，请输入的硬盘大小必须大于80G","温馨提示")
            } else if (ypdx_id_shuzi_2 >= 50 && ypdx_sel_2 == "T") {
                $("#ypdx_id_2").val("");
                $.alert("硬盘2大小以T为单位，请输入的硬盘大小不能大于50T","温馨提示")
            } else if (ypdx_id_shuzi_2 <= 80 && ypdx_sel_2 == "G") {
                $("#ypdx_id_2").val("");
                $.alert("硬盘2大小以G为单位，请输入的硬盘大小必须大于80G","温馨提示")
            } else if (ypdx_id_shuzi_3 >= 50 && ypdx_sel_3 == "T") {
                $("#ypdx_id_3").val("");
                $.alert("硬盘3大小以T为单位，请输入的硬盘大小不能大于50T","温馨提示")
            } else if (ypdx_id_shuzi_3 <= 80 && ypdx_sel_3 == "G") {
                $("#ypdx_id_3").val("");
                $.alert("硬盘3大小以G为单位，请输入的硬盘大小必须大于80G","温馨提示")
            } else if (xinr == "全公司上下查无此人") {
                $("#shiyr_id").val("")
                $("#shiyr_id").focus();
                $.alert("你查询的员工信息不在你现在的部门里面，请核对","温馨提示")
            } else {
                savesbforajax()
            }
        }
        yctable()
    }

    function confirm(title,content,ele) {
        $.confirm({
            title: title,
            content: content,
            buttons: {
                确定: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function(){
                        $(ele).modal('hide');
                    }
                }
            }
        });
    }

    function savesbforajax() {
        // alert($("#sbAddModal form").serialize())
        // $.ajax({
        //     url: "/sbgl/sbxxb/insertsb",
        //     type: 'POST',
        //     data: $("#sbAddModal form").serialize(),
        //     success: function (result) {
        //         if (result != null) {
        //             confirm("温馨提示","添加成功！！！","#sbAddModal")
        //             refresh()
        //         }
        //     }
        // });

        $.confirm({
            title: '温馨提示',
            content: '确定添加吗？？？',
            buttons: {
                确定: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        return $.ajax({
                            url: '/sbgl/sbxxb/insertsb',
                            method: 'POST',
                            data: $("#sbAddModal form").serialize()
                        }).done(function (response) {
                            $("#sbAddModal").modal('hide');
                            $.alert("添加成功","温馨提示")
                            updatesbflb()
                            refresh()
                        }).fail(function () {
                        });
                    }
                },
                取消: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                    },
                },
            },
        });

    }

    // $('#ypdx_id_1').bind('focus',function(){
    //     $.modal.open('添加用户', "/ypdx", '500', '300',callback);
    // })


    function xsqxx() {
        $('#sbAddModal').modal('hide');
        $("#xsqppcc").val("");
        $.confirm({
            title: '显示器品牌尺寸信息',
            content: '' +
                '<form action="" class="formName">' +
                '<div class="form-group">' +
                '<label>请输入显示器品牌，点击下拉框选择显示器尺寸大小</label>' +
                // '<input id="xsqpp" class="xsqpp form-control" list="browsersforxsq" placeholder="品牌助记码">'+
                // '<datalist id="browsersforxsq"></datalist>'+
                '<input id="xsqpp" class="xsqpp form-control" placeholder="请输入显示器品牌">' +
                '<select id="xsqcc" class="xsqcc form-control"><option value="">请选择显示器尺寸</option><option value="13寸">13寸</option><option value="14寸">14寸</option><option value="15寸">15寸</option><option value="17寸">17寸</option><option value="19寸">19寸</option><option value="19.5寸">19.5寸</option><option value="20寸">20寸</option><option value="23.5寸">23.5寸</option><option value="24寸">24寸</option><option value="25寸">25寸</option><option value="G">27寸</option></select>' +
                '</div>' +
                '</form>',
            buttons: {
                qdformSubmit: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        var xsqpp = this.$content.find('.xsqpp').val();
                        var xsqcc = this.$content.find('.xsqcc').val();
                        if (!xsqpp) {
                            $.alert('请输入显示器品牌',"温馨提示");
                            return false;
                        }
                        if (!xsqcc) {
                            $.alert('请选择显示器尺寸大小',"温馨提示");
                            return false;
                        }
                        $("#xsqppcc_id").val(xsqpp + "-" + xsqcc);
                        this.close()
                        $('#sbAddModal').modal('show');
                    }
                },
                cancel: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                        //close
                        $('#sbAddModal').modal('show');
                    },
                },
            },
            // onContentReady: function () {
            //     return $.ajax({
            //         url: '/sbgl/xsqxxb/getxsqxxb/',
            //         dataType: 'json',
            //         method: 'get',
            //     }).done(function (data) {
            //         $('#xsqppcc').empty();
            //         $('#browsersforxsq').empty();
            //         var options = "";   //字符串拼接
            //         for (var i in data) {  //遍历json数组
            //             options += "<option value='" + data[i].xsqpp + "'>" + data[i].zjm + "</option>"
            //             //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
            //         }
            //         $('#browsersforxsq').append(options);
            //     })
            // }
        });
    }

    $('#xsqcc_btn').click(function () {
        xsqxx()
    });

    var jxyp = "机械-";
    var gtyp = "固态-";

    function ypdx_1() {
        $('#sbAddModal').modal('hide');
        $("#ypdx_id_1").val("");
        $.confirm({
            title: '硬盘一信息',
            content: '' +
                '<form action="" class="formName">' +
                '<div class="form-group">' +
                '<label>请先输入硬盘大小后，点击下拉框选择硬盘单位</label>' +
                '<input type="text" placeholder="请输入硬盘大小，注意单位" class="name form-control"/>' +
                '<select class="ypdx form-control"><option value="T">T</option><option value="G">G</option> </select>' +
                '</div>' +
                '</form>',
            buttons: {
                jxypformSubmit: {
                    text: '机械硬盘',
                    btnClass: 'btn-blue',
                    action: function () {
                        var name = this.$content.find('.name').val();
                        var ypdx = this.$content.find('.ypdx').val();
                        if (!name) {
                            $.alert('硬盘空间大小不能为空',"温馨提示");
                            return false;
                        }
                        if (name <= 80 && ypdx == "G") {
                            $.alert('硬盘空间单位为G，填写的硬盘大小不能小于80G',"温馨提示");
                            return false;
                        }
                        if (name >= 50 && ypdx == "T") {
                            $.alert('硬盘空间单位为T，填写的硬盘大小不能大于50T',"温馨提示");
                            return false;
                        }
                        $("#ypdx_id_1").val(jxyp + name + ypdx);
                        $('#sbAddModal').modal('show');
                    }
                },

                gtypformSubmit: {
                    text: '固态硬盘',
                    btnClass: 'btn-green',
                    action: function () {
                        var name = this.$content.find('.name').val();
                        var ypdx = this.$content.find('.ypdx').val();
                        if (!name) {
                            $.alert('请输入硬盘大小',"温馨提示");
                            return false;
                        }
                        if (name <= 80 && ypdx == "G") {
                            $.alert('硬盘空间单位为G，填写的硬盘大小不能小于80G',"温馨提示","温馨提示");
                            return false;
                        }
                        if (name >= 50 && ypdx == "T") {
                            $.alert('硬盘空间单位为T，填写的硬盘大小不能大于50T',"温馨提示");
                            return false;
                        }
                        $("#ypdx_id_1").val(gtyp + name + ypdx);
                        $('#sbAddModal').modal('show');
                    }
                },
                cancel: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                        //close
                        $('#sbAddModal').modal('show');
                    },
                },
            },
        });
    }

    $('#ypdx_btn_1').click(function () {
        ypdx_1()
    });
    // $('#ypdx_id_1').bind('blur',function(){
    // $.ajax({
    //     url:"/nc/sbxxb/index",
    //     type:"get",
    //     data:{"op":[[${op}]]},
    //     success:function (data) {
    //         console.log(data)
    //         if($(this).val().length!=0){
    //             $(this).val($(this).val()+op)//添加字符
    //         }
    //     }
    // })
    // var op=[[${op}]];
    // alert(op);
    // var op=[[${yplxmc}]]
    // var url= window.location.search;


    //未用jquery-confirm
    // var jxyp="机械硬盘";
    // var gtyp="固态硬盘";
    //
    // if ($("#ypdx_id_1").val().length!=0) {
    //     var msg=confirm("是机械硬盘按确定，固态硬盘按取消")
    //     if (msg) {
    //         $('#ypdx_id_2').removeAttr("readOnly")
    //         $(this).val(jxyp+$(this).val());
    //     }else {
    //         $('#ypdx_id_2').removeAttr("readOnly")
    //         $(this).val(gtyp+$(this).val());
    //     }
    //
    // }else {
    //     $("#ypdx_id_1").focus();
    // }


    // if($("#ypdx_id_1").val().length<4&&$("#ypdx_id_1").val().length!=0){

    //     }else if($("#ypdx_id_1").val().length>=4){
    //         $("#ypdx_sel_1").focus();
    //     }else {
    //         $("#ypdx_id_1").focus();
    //     }
    // })

    function ypdx_2() {
        $('#sbAddModal').modal('hide');
        $("#ypdx_id_2").val("");
        $.confirm({
            title: '硬盘一信息',
            content: '' +
                '<form action="" class="formName">' +
                '<div class="form-group">' +
                '<label>请先输入硬盘大小后，点击下拉框选择硬盘单位</label>' +
                '<input type="text" placeholder="请输入硬盘大小，注意单位" class="name form-control"/>' +
                '<select class="ypdx form-control"><option value="T">T</option><option value="G">G</option> </select>' +
                '</div>' +
                '</form>',
            buttons: {
                jxypformSubmit: {
                    text: '机械硬盘',
                    btnClass: 'btn-blue',
                    action: function () {
                        var name = this.$content.find('.name').val();
                        var ypdx = this.$content.find('.ypdx').val();
                        if (!name) {
                            $.alert('硬盘空间大小不能为空',"温馨提示");
                            return false;
                        }
                        if (name <= 80 && ypdx == "G") {
                            $.alert('硬盘空间单位为G，填写的硬盘大小不能小于80G',"温馨提示");
                            return false;
                        }
                        if (name >= 50 && ypdx == "T") {
                            $.alert('硬盘空间单位为T，填写的硬盘大小不能大于50T',"温馨提示");
                            return false;
                        }
                        $("#ypdx_id_2").val(jxyp + name + ypdx);
                        $('#sbAddModal').modal('show');
                    }
                },

                gtypformSubmit: {
                    text: '固态硬盘',
                    btnClass: 'btn-green',
                    action: function () {
                        var name = this.$content.find('.name').val();
                        var ypdx = this.$content.find('.ypdx').val();
                        if (!name) {
                            $.alert('请输入硬盘大小',"温馨提示");
                            return false;
                        }
                        if (name <= 80 && ypdx == "G") {
                            $.alert('硬盘空间单位为G，填写的硬盘大小不能小于80G',"温馨提示");
                            return false;
                        }
                        if (name >= 50 && ypdx == "T") {
                            $.alert('硬盘空间单位为T，填写的硬盘大小不能大于50T',"温馨提示");
                            return false;
                        }
                        $("#ypdx_id_2").val(gtyp + name + ypdx);
                        $('#sbAddModal').modal('show');
                    }
                },
                cancel: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                        //close
                        $('#sbAddModal').modal('show');
                    },
                },
            },
        });
    }

    $('#ypdx_btn_2').click(function () {
        ypdx_2()
    });

    function ypdx_3() {
        $('#sbAddModal').modal('hide');
        $("#ypdx_id_3").val("");
        $.confirm({
            title: '硬盘一信息',
            content: '' +
                '<form action="" class="formName">' +
                '<div class="form-group">' +
                '<label>请先输入硬盘大小后，点击下拉框选择硬盘单位</label>' +
                '<input type="text" placeholder="请输入硬盘大小，注意单位" class="name form-control"/>' +
                '<select class="ypdx form-control"><option value="T">T</option><option value="G">G</option> </select>' +
                '</div>' +
                '</form>',
            buttons: {
                jxypformSubmit: {
                    text: '机械硬盘',
                    btnClass: 'btn-blue',
                    action: function () {
                        var name = this.$content.find('.name').val();
                        var ypdx = this.$content.find('.ypdx').val();
                        if (!name) {
                            $.alert('硬盘空间大小不能为空',"温馨提示");
                            return false;
                        }
                        if (name <= 80 && ypdx == "G") {
                            $.alert('硬盘空间单位为G，填写的硬盘大小不能小于80G',"温馨提示");
                            return false;
                        }
                        if (name >= 50 && ypdx == "T") {
                            $.alert('硬盘空间单位为T，填写的硬盘大小不能大于50T',"温馨提示");
                            return false;
                        }
                        $("#ypdx_id_3").val(jxyp + name + ypdx);
                        $('#sbAddModal').modal('show');
                    }
                },

                gtypformSubmit: {
                    text: '固态硬盘',
                    btnClass: 'btn-green',
                    action: function () {
                        var name = this.$content.find('.name').val();
                        var ypdx = this.$content.find('.ypdx').val();
                        if (!name) {
                            $.alert('请输入硬盘大小',"温馨提示");
                            return false;
                        }
                        if (name <= 80 && ypdx == "G") {
                            $.alert('硬盘空间单位为G，填写的硬盘大小不能小于80G',"温馨提示");
                            return false;
                        }
                        if (name >= 50 && ypdx == "T") {
                            $.alert('硬盘空间单位为T，填写的硬盘大小不能大于50T',"温馨提示");
                            return false;
                        }
                        $("#ypdx_id_3").val(gtyp + name + ypdx);
                        $('#sbAddModal').modal('show');
                    }
                },
                cancel: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                        //close
                        $('#sbAddModal').modal('show');
                    },
                },
            }
        });
    }

    $('#ypdx_btn_3').click(function () {
        ypdx_3()
    });


    function callback(index, layero) {
        $.alert("进入回调函数了","温馨提示")
        $.modal.closeAll()
    }

    function sbypdx() {
        $.modal.open('添加用户', "/demo/modal/ypdx", '500', '300', callback);
    }

    /**
     * 当ip和Mac有初始值时，将其拆开，显示在每一个文本框中
     * */
        //添加 Mac
    var macShow = "";
    var resultMac = macShow.split(":");
    $("#macdz_id>.mac1").val(resultMac[0]);
    $("#macdz_id>.mac2").val(resultMac[1]);
    $("#macdz_id>.mac3").val(resultMac[2]);
    $("#macdz_id>.mac4").val(resultMac[3]);
    $("#macdz_id>.mac5").val(resultMac[4]);
    $("#macdz_id>.mac6").val(resultMac[5]);
    //修改mac
    var macShowupdate = "";
    var resultMacupdate = macShowupdate.split(":");
    $("#macdz_update>.mac1update").val(resultMacupdate[0]);
    $("#macdz_update>.mac2update").val(resultMacupdate[1]);
    $("#macdz_update>.mac3update").val(resultMacupdate[2]);
    $("#macdz_update>.mac4update").val(resultMacupdate[3]);
    $("#macdz_update>.mac5update").val(resultMacupdate[4]);
    $("#macdz_update>.mac6update").val(resultMacupdate[5]);

    //修改IP
    var ipShowupdate = "";
    var resultIpupdate = ipShowupdate.split(".");
    $("#ipdz_update>.ip1").val(resultIpupdate[0]);
    $("#ipdz_update>.ip2").val(resultIpupdate[1]);
    $("#ipdz_update>.ip3").val(resultIpupdate[2]);
    $("#ipdz_update>.ip4").val(resultIpupdate[3]);
    // 添加ip
    var ipShow = "";
    var resultIp = ipShow.split(".");
    $("#ipdz_id>.ip1").val(resultIp[0]);
    $("#ipdz_id>.ip2").val(resultIp[1]);
    $("#ipdz_id>.ip3").val(resultIp[2]);
    $("#ipdz_id>.ip4").val(resultIp[3]);

    /**
     * mac发生变化时调用即可
     * 将每一个小格中的值获取到传给后台
     * 如果小格中没有值则传空值，有值则传value值，并在后面加上：封号，最后一个不用加
     * */
    function macc() {
        var mac1, mac2, mac3, mac4, mac5, mac6;
        if ($("#macdz_id>.mac1").val() == '') {
            mac1 = '';
        } else {
            mac1 = $("#macdz_id>.mac1").val() + '-';
        }
        if ($("#macdz_id>.mac2").val() == '') {
            mac2 = '';
        } else {
            mac2 = $("#macdz_id>.mac2").val() + '-';
        }
        if ($("#macdz_id>.mac3").val() == '') {
            mac3 = '';
        } else {
            mac3 = $("#macdz_id>.mac3").val() + '-';
        }
        if ($("#macdz_id>.mac4").val() == '') {
            mac4 = '';
        } else {
            mac4 = $("#macdz_id>.mac4").val() + '-';
        }
        if ($("#macdz_id>.mac5").val() == '') {
            mac5 = '';
        } else {
            mac5 = $("#macdz_id>.mac5").val() + '-';
        }
        if ($("#macdz_id>.mac6").val() == '') {
            mac6 = '';
        } else {
            mac6 = $("#macdz_id>.mac6").val();
        }
        var macc = mac1 + mac2 + mac3 + mac4 + mac5 + mac6;
        $("#mac").val(macc);
    }

    function maccupdate() {
        var mac1update, mac2update, mac3update, mac4update, mac5update, mac6update;
        if ($("#macdz_update>.mac1update").val() != '') {
            mac1update = $("#macdz_update>.mac1update").val() + '-';
        }
        if ($("#macdz_update>.mac2update").val() != '') {
            mac2update = $("#macdz_update>.mac2update").val() + '-';
        }
        if ($("#macdz_update>.mac3update").val() != '') {
            mac3update = $("#macdz_update>.mac3update").val() + '-';
        }
        if ($("#macdz_update>.mac4update").val() != '') {
            mac4update = $("#macdz_update>.mac4update").val() + '-';
        }
        if ($("#macdz_update>.mac5update").val() != '') {
            mac5update = $("#macdz_update>.mac5update").val() + '-';
        }
        if ($("#macdz_update>.mac6update").val() != '') {
            mac6update = $("#macdz_update>.mac6update").val();
        }
        var maccupdate = mac1update + mac2update + mac3update + mac4update + mac5update + mac6update;
        // alert(maccupdate)
        return maccupdate;
    }

    /**
     * ip发生变化时调用即可
     * 同Mac一样
     * */
    function ipp() {
        var ip1, ip2, ip3, ip4;
        if ($("#ipdz_id>.ip1").val() == '') {
            ip1 = '';
        } else {
            ip1 = $("#ipdz_id>.ip1").val() + '.';
        }
        if ($("#ipdz_id>.ip2").val() == '') {
            ip2 = '';
        } else {
            ip2 = $("#ipdz_id>.ip2").val() + '.';
        }
        if ($("#ipdz_id>.ip3").val() == '') {
            ip3 = '';
        } else {
            ip3 = $("#ipdz_id>.ip3").val() + '.';
        }
        if ($("#ipdz_id>.ip4").val() == '') {
            ip4 = '';
        } else {
            ip4 = $("#ipdz_id>.ip4").val();
        }
        var ipp = ip1 + ip2 + ip3 + ip4;
        $("#ip").val(ipp);
    }

    function ippupdate() {
        var ip1, ip2, ip3, ip4;
        if ($("#ipdz_update>.ip1").val() != '') {
            ip1 = $("#ipdz_update>.ip1").val() + '.';
        }
        if ($("#ipdz_update>.ip2").val() != '') {
            ip2 = $("#ipdz_update>.ip2").val() + '.';
        }
        if ($("#ipdz_update>.ip3").val() != '') {
            ip3 = $("#ipdz_update>.ip3").val() + '.';
        }
        if ($("#ipdz_update>.ip4").val() != '') {
            ip4 = $("#ipdz_update>.ip4").val();
        }
        var ipp = ip1 + ip2 + ip3 + ip4;
        return ipp;
    }

    /**
     * mac地址格式
     * 键盘按方向键上下左右，光标在四个input中来回切换
     */
    $('#macdz_id>input').each(function (i, o) {
        $(this).attr('cust_index', i);
    })

    $('#macdz_update>input').each(function (i, o) {
        $(this).attr('cust_index', i);
    })

    $('#macdz_id>input').keydown(function (event) {
        var keycode = event.which;
        //从最后一个小格开始删除，删完之后直接跳到前一个小格中继续删除
        if (event.keyCode == 8 && $(this).val().length == 0) {
            $(this).prev().focus();
        }
        if (38 != keycode && 40 != keycode && 37 != keycode && 39 != keycode) {
            return;
        }
        var ti = $(this).attr('cust_index');
        if (39 == keycode || 40 == keycode) {
            //down
            ti++;
        } else {
            //up
            ti--;
        }
        if (ti < 0) {
            ti = 0;
        }
        var next_obj = $('#macdz_id>input[cust_index=' + ti + ']');
        if (next_obj) {
            next_obj.focus();
        }
    })

    $('#macdz_update>input').keydown(function (event) {
        var keycode = event.which;
        //从最后一个小格开始删除，删完之后直接跳到前一个小格中继续删除
        if (event.keyCode == 8 && $(this).val().length == 0) {
            $(this).prev().focus();
        }
        if (38 != keycode && 40 != keycode && 37 != keycode && 39 != keycode) {
            return;
        }
        var ti = $(this).attr('cust_index');
        if (39 == keycode || 40 == keycode) {
            //down
            ti++;
        } else {
            //up
            ti--;
        }
        if (ti < 0) {
            ti = 0;
        }
        var next_obj = $('#macdz_update>input[cust_index=' + ti + ']');
        if (next_obj) {
            next_obj.focus();
        }
    })


    /**
     * 限制mac输入，以及跳下一格的条件
     * */
    $('#macdz_id>input').bind('input propertychange', function () {
        //限制mac只能输入数字母
        var c = $(this);
        //截取输入的最后一个字符
        var lastStr = c.val().substr(c.val().trim().length - 1, 1);
        if (/[^\w]/.test(c.val())) {
            //替换非字母和数字字符，当输入不是字母或数字的时候用空替换
            var temp_amount = c.val().replace(/[^\w]/g, '');
            $(this).val(temp_amount);
            // 当前小格输入的最后一个字符是.并且长度不等于空
            if (/[-]/.test(lastStr) && $(this).val() != '') {
                $(this).next().focus();
            }
        }
        //当前小格输入长度为2时自动跳到下一格
        if ($(this).val().trim().length == 2) {
            $(this).next().focus();
        }
    })

    $('#macdz_update>input').bind('input propertychange', function () {
        //限制mac只能输入数字母
        var c = $(this);
        //截取输入的最后一个字符
        var lastStr = c.val().substr(c.val().trim().length - 1, 1);
        if (/[^\w]/.test(c.val())) {
            //替换非字母和数字字符，当输入不是字母或数字的时候用空替换
            var temp_amount = c.val().replace(/[^\w]/g, '');
            $(this).val(temp_amount);
            // 当前小格输入的最后一个字符是.并且长度不等于空
            if (/[-]/.test(lastStr) && $(this).val() != '') {
                $(this).next().focus();
            }
        }
        //当前小格输入长度为2时自动跳到下一格
        if ($(this).val().trim().length == 2) {
            $(this).next().focus();
        }
    })

    $('#macdz_id>input').bind('blur', function () {
        if ($(this).val().trim().length < 2) {
            $(this).focus();
            return false;
        }
        macc();
    })

    $('#macdz_update>input').bind('blur', function () {
        if ($(this).val().trim().length == 2) {
            $("#macupdate").val(maccupdate())
        }
    })


    $('#macdz_id>.mac6').bind('blur', function () {
        if ($("#macdz_id>.mac6").val().trim().length < 2) {
            $("#macdz_id>.mac6").focus();
            return false;
        }
        macc();
    })

    /**
     * 限制ip输入，以及跳下一格的条件
     * */
    $('#ipdz_id>input').bind('input propertychange', function () {
        // 输入不是数字的时候清空
        var c = $(this);
        //截取输入的最后一个字符
        var lastStr = c.val().substr(c.val().trim().length - 1, 1);
        if (/[^\d]/.test(c.val())) {
            //替换非数字字符
            var temp_amount = c.val().replace(/[^\d]/g, '');
            $(this).val(temp_amount);
            // 当前小格输入的最后一个字符是.并且长度不等于空
            if (/[.]/.test(lastStr) && $(this).val() != '') {
                $(this).next().focus();
            }
        }
        // 第二，三，四位输入不在0-255之间的时候清空
        if ($(this).val() < 0 || $(this).val() > 255) {
            $(this).val('');
        }
        //第一位输入不在1-223之间的时候清空
        if ($("#ipdz_id>.ip1").val() < 1 || $("#ipdz_id>.ip1").val() > 223) {
            $("#ipdz_id>.ip1").val('');
        }
        //当每一小格输入的长度等于3时，自动跳到下一个
        if ($(this).val().trim().length == 3) {
            $(this).next().focus();
        }
        ipp();
    })


    $('#ipdz_update>input').bind('input propertychange', function () {
        // 输入不是数字的时候清空
        var c = $(this);
        //截取输入的最后一个字符
        var lastStr = c.val().substr(c.val().trim().length - 1, 1);
        if (/[^\d]/.test(c.val())) {
            //替换非数字字符
            var temp_amount = c.val().replace(/[^\d]/g, '');
            $(this).val(temp_amount);
            // 当前小格输入的最后一个字符是.并且长度不等于空
            if (/[.]/.test(lastStr) && $(this).val() != '') {
                $(this).next().focus();
            }
        }
        // 第二，三，四位输入不在0-255之间的时候清空
        if ($(this).val() < 0 || $(this).val() > 255) {
            $(this).val('');
        }
        //第一位输入不在1-223之间的时候清空
        if ($("#ipdz_update>.ip1").val() < 1 || $("#ipdz_update>.ip1").val() > 223) {
            $("#ipdz_update>.ip1").val('');
        }
        //当每一小格输入的长度等于3时，自动跳到下一个
        if ($(this).val().trim().length == 3) {
            $(this).next().focus();
        }
        $("#ipupdate").val(ippupdate())
    })


    /**
     * ip地址格式
     * 键盘按方向键上下左右，光标在四个input中来回切换
     */
    $('#ipdz_id>input').each(function (i, o) {
        $(this).attr('cust_index', i);
    })

    $('#ipdz_update>input').each(function (i, o) {
        $(this).attr('cust_index', i);
    })

    $('#ipdz_id>input').keydown(function (event) {
        var keycode = event.which;
        //从最后一个小格开始删除，删完之后直接跳到前一个小格中继续删除
        if (event.keyCode == 8 && $(this).val().length == 0) {
            $(this).prev().focus();
        }
        if (38 != keycode && 40 != keycode && 37 != keycode && 39 != keycode) {
            return;
        }
        var ti = $(this).attr('cust_index');
        if (39 == keycode || 40 == keycode) {
            //down
            ti++;
        } else {
            //up
            ti--;
        }
        if (ti < 0) {
            ti = 0;
        }
        var next_obj = $('#ipdz_id>input[cust_index=' + ti + ']');
        if (next_obj) {
            next_obj.focus();
        }
    })

    $('#ipdz_update>input').keydown(function (event) {
        var keycode = event.which;
        //从最后一个小格开始删除，删完之后直接跳到前一个小格中继续删除
        if (event.keyCode == 8 && $(this).val().length == 0) {
            $(this).prev().focus();
        }
        if (38 != keycode && 40 != keycode && 37 != keycode && 39 != keycode) {
            return;
        }
        var ti = $(this).attr('cust_index');
        if (39 == keycode || 40 == keycode) {
            //down
            ti++;
        } else {
            //up
            ti--;
        }
        if (ti < 0) {
            ti = 0;
        }
        var next_obj = $('#ipdz_update>input[cust_index=' + ti + ']');
        if (next_obj) {
            next_obj.focus();
        }
    })
    // let sbhb_sel_index=""
    // $('#sbbh_sel').click(function () {
    //     sbhb_sel_index = document.getElementById("sbbh_sel").selectedIndex;
    // })


    // $(function () {
    //     var mysel = $("#sbbh_sel");
    //     // var mysel = document.getElementById("sbbh_sel");
    //     mysel.data("last", mysel.val()).change(function () {
    //         var oldvalue = mysel.data("last").; //这次改变之前的值
    //         mysel.data("last", mysel.val()); //每次改变都附加上去，以便下次变化时获取 改变之前获取并保存
    //         var newvalue = mysel.val(); //当前选中值
    //         alert("改变前的值："+oldvalue+",改变后的值："+newvalue);
    //     });
    // });


    $('#sbbh_sel').change(function () {
        var sel = document.getElementById("sbbh_sel")
        var sbmc_sel_xg = $("#sbbh_sel option:selected").text();
        var sbmc_sel_val = $("#sbbh_sel option:selected").val();
        var sbmc_sel_index = sel.selectedIndex + 1
        $('#ypdx_btn_1').attr("disabled", "disabled").unbind("click")
        $('#ypdx_btn_2').attr("disabled", "disabled").unbind("click")
        $('#ypdx_btn_3').attr("disabled", "disabled").unbind("click")
        $('#xsqcc_btn').attr("disabled", "disabled").unbind("click")
        $('#creat_sbbh_btn').removeAttr("disabled").bind("click", sbbhsc)
        // sbmc_index
        // var sbmc_sel_xinz = $("#sbbh_sel option:selected").val();

        $.confirm({
            title: '提示!',
            content: '您确定修改设备类型吗？确定请按确定(同时你添加的设备不是电脑或服务器，背景颜色是灰色的不用填写)，否则按取消',
            buttons: {
                confirm: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        $("#ypdx_id_1").val("");
                        $("#ypdx_id_2").val("");
                        $("#ypdx_id_3").val("");
                        $("#sbbh_id").val("")
                        $("#sbmc_id").val(sbmc_sel_xg)
                        $("#sbmc_option").val(sbmc_sel_val)
                        $("#sbmc_index").val(sbmc_sel_index)
                        $("#guige_id").val("")
                        $("#shccj_id").val("")
                        $("#gmrq_id").val("")
                        $("#bmid_id").val("")
                        $("#shiyr_id").val("")
                        $('#zbxh_id').val("")
                        $('#cpuxh_id').val("")
                        $('#ncggdx_id').val("")
                        $('#xkxh_id').val("")
                        $('#ypdx_id_1').val("")
                        $('#ypdx_id_2').val("")
                        $('#ypdx_id_3').val("")
                        $('#xsqppcc_id').val("")
                        $("#macdz_id>.mac1").val("")
                        $("#macdz_id>.mac2").val("")
                        $("#macdz_id>.mac3").val("")
                        $("#macdz_id>.mac4").val("")
                        $("#macdz_id>.mac5").val("")
                        $("#macdz_id>.mac6").val("")
                        $("#beiz_id").val("")
                        $("#ipdz_id>.ip1").val("")
                        $("#ipdz_id>.ip2").val("")
                        $("#ipdz_id>.ip3").val("")
                        $("#ipdz_id>.ip4").val("")
                        if (sbmc_sel_xg.indexOf("脑") < 0 && sbmc_sel_xg.indexOf("务器") < 0) {
                            $("#zbxh_id").attr("readOnly", "readOnly")
                            $("#cpuxh_id").attr("readOnly", "readOnly")
                            $("#ncggdx_id").attr("readOnly", "readOnly")
                            $("#xkxh_id").attr("readonly", "readonly")
                            $("#xsqppcc_id").attr("readOnly", "readOnly")
                            $('#ipdz1').attr("readOnly", "readOnly")
                            $('#ipdz2').attr("readOnly", "readOnly")
                            $('#ipdz3').attr("readOnly", "readOnly")
                            $('#ipdz4').attr("readOnly", "readOnly")
                            $('.mac1').attr("readOnly", "readOnly")
                            $('.mac2').attr("readOnly", "readOnly")
                            $('.mac3').attr("readOnly", "readOnly")
                            $('.mac4').attr("readOnly", "readOnly")
                            $('.mac5').attr("readOnly", "readOnly")
                            $('.mac6').attr("readOnly", "readOnly")
                            document.getElementById('xsqppcc_id').style.backgroundColor = "#eeeeee"
                            document.getElementById('ypdx_id_1').style.backgroundColor = "#eeeeee"
                            document.getElementById('ypdx_id_2').style.backgroundColor = "#eeeeee"
                            document.getElementById('ypdx_id_3').style.backgroundColor = "#eeeeee"
                            $('#ypdx_btn_1').attr("disabled", "disabled").unbind("click")
                            $('#ypdx_btn_2').attr("disabled", "disabled").unbind("click")
                            $('#ypdx_btn_3').attr("disabled", "disabled").unbind("click")
                            $('#xsqcc_btn').attr("disabled", "disabled").unbind("click")
                            $('#creat_sbbh_btn').removeAttr("disabled").bind("click", sbbhsc)
                        } else {
                            $("#zbxh_id").removeAttr("readOnly")
                            $("#cpuxh_id").removeAttr("readOnly")
                            $("#ncggdx_id").removeAttr("readOnly")
                            $("#xkxh_id").removeAttr("readonly")
                            $('#ipdz1').removeAttr("readOnly")
                            $('#ipdz2').removeAttr("readOnly")
                            $('#ipdz3').removeAttr("readOnly")
                            $('#ipdz4').removeAttr("readOnly")
                            $('.mac1').removeAttr("readOnly")
                            $('.mac2').removeAttr("readOnly")
                            $('.mac3').removeAttr("readOnly")
                            $('.mac4').removeAttr("readOnly")
                            $('.mac5').removeAttr("readOnly")
                            $('.mac6').removeAttr("readOnly")
                            document.getElementById('ypdx_id_1').style.backgroundColor = "#ffffff"
                            document.getElementById('ypdx_id_2').style.backgroundColor = "#ffffff"
                            document.getElementById('ypdx_id_3').style.backgroundColor = "#ffffff"
                            document.getElementById('xsqppcc_id').style.backgroundColor = "#ffffff"
                            $('#ypdx_btn_1').removeAttr("disabled").bind("click", ypdx_1)
                            $('#ypdx_btn_2').removeAttr("disabled").bind("click", ypdx_2)
                            $('#ypdx_btn_3').removeAttr("disabled").bind("click", ypdx_3)
                            $('#xsqcc_btn').removeAttr("disabled").bind("click", xsqxx)
                            $('#creat_sbbh_btn').removeAttr("disabled").bind("click", sbbhsc)
                        }
                    }
                },
                cancel: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                        // console.log($("#sbbh_sel").val(sb));
                        // alert(sbhb_sel_index)
                        // document.getElementById("sbbh_sel").options[sbhb_sel_index].selected = true;
                        // var sbmc_xin = $("#sbmc_id").val()
                        var sbmc_xin_option = $("#sbmc_option").val()
                        // var sbmc_sel_index = $("#sbmc_index").val()
                        // $("#sbbh_sel").prepend("<option value='" + sbmc_xin_option + "' selected>" + sbmc_xin + "</option>");
                        // $("#sbbh_sel option[text='"+sbmc_xin+"']").remove();  //删除Select中Text='4'的Option
                        // $("#sbbh_sel option[index='0']").remove();
                        // $("#sbbh_sel option[value='sbmc_xin']").remove();
                        // $("#sbbh_sel option[index='0']").remove();
                        // var sel = document.getElementById("sbbh_sel");
                        // sel.options.remove(sel.options[0]);//删除第一个下拉框选项
                        // 删除下标的option项
                        // sel.options.remove(sbmc_sel_index)
                        // alert(sel)
                        // alert(sel.value)
                        sel.value = sbmc_xin_option;
                    },
                }
            }
        });
    })

    function tjsb() {
        var url = "/tianjia"
        if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) { //移动端
            window.location.href = "/tianjia"
        } else {
            gettjmtk()
        }
    }

    function getwhxx(miaos) {
        var shuju=""
        $.ajax({
            url: "/sbgl/wenhb/getlist/" + miaos+"/"+gsid,
            type: 'GET',
            async: false,
            success: function (data) {
                shuju=data
            },
        })
        return shuju
    }

    function DydjbById(row, index) {
        $.confirm({
            title: '请选择打印类型!',
            content: '',
            buttons: {
                登记表: {
                    text: '登记表',
                    btnClass: 'btn-green',
                    action: function(){
                        var data = JSON.stringify($("#bootstrap-table").bootstrapTable('getData')); //获取全部数据
                        var data_json = JSON.parse(data); //data_json和data_json2一样都是json对象
                        $("#tbody_djb").empty();
                        var options = "";   //字符串拼接
                        options = "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>设备编号</th>"
                            + "<td colspan='7' style='text-align: center' class='text-center'>" + data_json[index].sbbh + "</td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>设备名称</th>"
                            + "<td colspan='7' style='text-align: center' class='text-center'>" + data_json[index].sbmc + "</td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>品牌型号</th>"
                            + "<td colspan='7' style='text-align: center' class='text-center'>" + data_json[index].shccj + "</td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>购买时间</th>"
                            + "<td colspan='3' style='text-align: center;width: 100px' class='text-center '>" + data_json[index].gmrq + "</td>"
                            + "<th scope='row' style='width: 130px;background-color: #99CCFF' class='text-center'>显示器购买时间</th>"
                            + "<td colspan='3' style='text-align: center;width: 220px' class='text-center '>" + data_json[index].xsqgmrq + "</td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</th>"
                            + "<td colspan='7' style='text-align: center' class='text-center'>" + data_json[index].beiz + "</td>"
                            + "</tr>";
                        $("#tbody_djb").append(options);
                        $("#tbody_pzcs").empty();
                        var tbody = "";   //字符串拼接
                        tbody = "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>CPU</th>"
                            + "<td colspan='7' style='text-align: center' class='text-center'>" + data_json[index].cpuxh + "</td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>主板</th>"
                            + "<td colspan='7' style='text-align: center' class='text-center'>" + data_json[index].zbxh + "</td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>内存</th>"
                            + "<td colspan='7' style='text-align: center' class='text-center'>" + data_json[index].ncggdx + "</td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>硬盘</th>"
                            + "<td colspan='7' style='text-align: center' class='text-center'>" + data_json[index].ypdx + "</td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>显卡</th>"
                            + "<td colspan='7' style='text-align: center' class='text-center'>" + data_json[index].xkxh + "</td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>MAC</th>"
                            + "<td colspan='7' style='text-align: center' class='text-center'>" + data_json[index].macdz + "</td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>备&nbsp;&nbsp;注</th>"
                            + "<td colspan='7' style='text-align: center' class='text-center'>" + data_json[index].beiz + "</td>"
                            + "</tr>";
                        $("#tbody_pzcs").append(tbody);

                        $("#tbody_mqzt").empty();
                        var tbodymqzt = "";   //字符串拼接
                        tbodymqzt = "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>使用部门</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>使用部门</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>使用部门</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>使用部门</th>"
                            + "<td class='text-center'></td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>操作员工</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>操作员工</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>操作员工</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>操作员工</th>"
                            + "<td class='text-center'></td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>使用部门</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>使用部门</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>使用部门</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>使用部门</th>"
                            + "<td class='text-center'></td>"
                            + "</tr>"
                            + "<tr>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>操作员工</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>操作员工</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>操作员工</th>"
                            + "<td class='text-center'></td>"
                            + "<th scope='row' style='width: 80px;background-color: #99CCFF' class='text-center'>操作员工</th>"
                            + "<td class='text-center'></td>"
                            + "</tr>";
                        $("#tbody_mqzt").append(tbodymqzt);
                        var miaos="计算机设备登记表"
                        var sbxq = $('#divid_sbxq').html();
                        var pzcs = $('#divid_sbpzcs').html();
                        var mqzt = $('#divid_sbmqzt').html();
                        var opt = $('#divid_sbwh').html();
                        LODOP = getLodop();
                        LODOP.PRINT_INIT("");
                        LODOP.ADD_PRINT_TEXT(25, 500, 350, 30, getwhxx(miaos)==""?"计算机设备登记表":getwhxx(miaos)[0].whmc);
                        LODOP.SET_PRINT_STYLEA(0, "FontSize", 28);
                        LODOP.SET_PRINT_STYLEA(0, "bold", 1);
                        LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
                        LODOP.SET_PRINT_STYLEA(0, "Horient", 2);

                        LODOP.ADD_PRINT_TEXT(61, 650, 180, 21, getwhxx(miaos)==""?"":getwhxx(miaos)[0].wenh);
                        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
                        LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
                        LODOP.SET_PRINT_STYLEA(0, "Horient", 1);
                        LODOP.SET_PRINT_STYLEA(0, "bold", 1);
                        LODOP.ADD_PRINT_TABLE(78, 50, 2970, 2100, sbxq);
                        LODOP.ADD_PRINT_TABLE(265, 50, 2970, 2100, pzcs);
                        LODOP.ADD_PRINT_TABLE(510, 50, 2970, 2100, mqzt);
                        LODOP.ADD_PRINT_TABLE(690, 50, 2970, 2100, opt);
                        LODOP.PREVIEW();
                    }
                },
                养护表: {
                    text: '养护表',
                    btnClass: 'btn-blue',
                    action: function(){
                        var data = JSON.stringify($("#bootstrap-table").bootstrapTable('getData')); //获取全部数据
                        var data_json = JSON.parse(data); //data_json和data_json2一样都是json对象
                        $("#sbmc_yh").html(data_json[index].sbmc)
                        $("#sbbh_yh").html(data_json[index].sbbh)
                        $("#bm_yh").html(data_json[index].bm)
                        $("#tbody_yh").empty();
                        var tbody_yhs = "";   //字符串拼接
                        var tbody_yhss = "";
                        tbody_yhs = "<tr>"
                            + "<td align='center' style='font-size: 14px;width: 70px' class='text-center'>序号</td>"
                            + "<td align='center' style='font-size: 14px;width: 50px' class='text-center'>记录日期</td>"
                            + "<td colspan='3'  align='center' style='font-size: 14px;width: 100px' class='text-center'>养护内容</td>"
                            + "<td align='center' style='font-size: 14px' class='text-center'>操作人签字</td>"
                            + "<td align='center' style='font-size: 14px;width: 100px' class='text-center'>确认人签字</td>"
                            + "<td align='center' style='font-size: 14px' class='text-center'>备注</td>"
                            + "</tr>";
                        for (var i=1;i<=30;i++){
                            tbody_yhss += "<tr style='font-size: 12px'>"
                                + "<td align='center' class='text-center'>"+i+"</td>"
                                + "<td align='center' style='text-align: right;width: 20px'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年&nbsp;&nbsp;&nbsp;&nbsp;月&nbsp;&nbsp;&nbsp;&nbsp;日&nbsp;</td>"
                                + "<td align='center' colspan='3' style='width: 100px' class='text-center'>计算机内部清洁、风扇、线路检查、系统维护</td>"
                                + "<td align='center' class='text-center'></td>"
                                + "<td align='center' class='text-center'></td>"
                                + "<td align='center' class='text-center'></td>"
                                + "</tr>";
                        }
                        $("#tbody_yh").append(tbody_yhs);
                        $("#tbody_yh").append(tbody_yhss);

                        LODOP = getLodop();
                        LODOP.PRINT_INIT("");
                        LODOP.ADD_PRINT_TEXT(25, 500, 250, 30, "设备养护记录");
                        LODOP.SET_PRINT_STYLEA(0, "FontSize", 28);
                        LODOP.SET_PRINT_STYLEA(0, "bold", 1);
                        LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
                        LODOP.SET_PRINT_STYLEA(0, "Horient", 2);

                        // LODOP.ADD_PRINT_TEXT(61, 650, 180, 21, "HWGA-QR-115-2017-01");
                        // LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
                        // LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
                        // LODOP.SET_PRINT_STYLEA(0, "Horient", 1);
                        // LODOP.SET_PRINT_STYLEA(0, "bold", 1);
                        var sbxq = $('#divid_sbyh').html();
                        LODOP.ADD_PRINT_TABLE(78, 50, 2970, 2100, sbxq);
                        LODOP.ADD_PRINT_TEXT(1045, 690, 80, 30, "信息管理部");
                        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
                        LODOP.SET_PRINT_STYLEA(0, "bold", 1);
                        // LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
                        // LODOP.SET_PRINT_STYLEA(0, "Horient", 2);
                        LODOP.PREVIEW();
                    }
                },
                取消: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function(){
                    }
                }
            }
        });
    }

</script>
</body>
</html>